简体   繁体   English

简单成员资格:我可以在不引用webmatrix的情况下创建用户吗?

[英]Simple Membership: can I create a user without referencing webmatrix?

I have my restrictions to not to reference webmatrix here. 我有限制不在这里引用webmatrix。

I want to create a user record in membership tables of simple membership (using EF 5). 我想在简单成员资格的成员资格表中创建用户记录(使用EF 5)。 To make it easier, I have mapped EF Models to those tables. 为了更容易,我已将EF模型映射到这些表。

Is it possible to with code without webmatrix ? 没有webmatrix的代码是否可能?


EDIT 编辑

I don't want to use any membership provider. 我不想使用任何会员提供者。

EDIT 编辑

The system uses simple membership. 系统使用简单的成员资格。 I don't want to change that. 我不想改变这一点。 From a separate project, I want to add a user to that database without referencing WebMatrix. 在一个单独的项目中,我想在不引用WebMatrix的情况下将用户添加到该数据库。 Is that possible ? 那可能吗 ?

使用标准的ASP.NET成员资格,您可以使用System.Web.Security.Membership.CreateUser创建新用户。

No, you cannot use SimpleMembership without WebMatrix as SimpleMembership lives in the WebMatrix namespace. 不,没有WebMatrix就不能使用SimpleMembership,因为SimpleMembership存在于WebMatrix名称空间中。

You can, however, use any number of other membership providers, such as the original SqlMembershipProvider, the Universal Providers, or any number others that are available. 但是,您可以使用任意数量的其他成员资格提供程序,例如原始SqlMembershipProvider,Universal Providers或任何其他可用的成员资格提供程序。

EDIT: 编辑:

Yes, you can add a user to the database manually. 是的,您可以手动将用户添加到数据库。 In the comments below I have included a link to the source for SimpleMembershipProvider.cs, examine that code and use the same methods in your own project. 在下面的评论中,我已经包含了一个指向SimpleMembershipProvider.cs源代码的链接,检查该代码并在您自己的项目中使用相同的方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法获取MVC5中引用的用于简单成员资格的Webmatrix.WebData? - Can't get Webmatrix.WebData for Simple Membership referenced in MVC5? 如何检查用户是否属于具有 MVC4 简单成员资格的几种不同角色中的任何一种? - How can I check if a user is in any one of a few different roles with MVC4 Simple membership? 如何通过成员身份创建用户,而无需在创建后登录到其帐户? - How do I create a user through membership without being logged into their account after creation? 成员资格创建用户providerError - Membership create user providerError 是否可以在不创建成员资格信息的情况下创建DNN用户? - Is it possible to create a DNN User without creating the membership information? 我可以在不实现整个Membership provider爵士乐的情况下,向几个ASP.NET MVC路由添加简单身份验证的快速方法是什么? - What is a quick way I can add simple authentication to a few ASP.NET MVC routes, without implementing the whole Membership provider jazz? 自定义简单成员资格/ WebMatrix Websecurity? 是否可以抑制OAuth表? 删除密码字段? - Customizing Simple Membership/WebMatrix Websecurity? Ability to suppress OAuth Tables? Delete password field? 如何在空的成员资格表中创建自己的密码? - How I can create my own password in an empty membership table? WebMatrix.WebData无法从单独的ASP.NET应用程序中读取成员资格信息 - WebMatrix.WebData can't read membership information from a separate ASP.NET application 为什么要注册第二个用户时,MVC简单会员身份令牌返回null? - Why MVC Simple Membership token returns null when i want to register second user?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM