简体   繁体   English

我可以在自己的用户数据库中使用ASP.NET WebForms中的成员资格提供程序吗? 如果是这样,怎么办?

[英]Can I use the Membership provider in ASP.NET WebForms with my own User database? If so, how?

I am looking for ways to implement login functionality in my ASP.NET WebForms application. 我正在寻找在ASP.NET WebForms应用程序中实现登录功能的方法。
I know that I can use the default Membership provider which creates its own tables. 我知道我可以使用默认的成员资格提供程序来创建自己的表。 I want to know if I can use my own schema for the database. 我想知道是否可以对数据库使用自己的架构。 I don't want to install the Membership tables in my database or otherwise. 我不想在数据库中安装Membership表。
I have an existing database with an existing structure that I cannot modify. 我有一个具有无法修改的现有结构的现有数据库。

Or do I have to go the hard way and write my own membership provider like this suggests. 还是我必须努力地编写像这样的建议自己的会员资格提供者。 If yes, then please be kind enough to point me to some tutorials about how to write a basic membership provider. 如果是,那么请给我足够的指导,指导我一些有关如何编写基本成员资格提供程序的教程。

You can simply customize the standard membership UserProfile table like in these examples: (1) , (2) . 您可以像下面的示例一样简单地自定义标准成员资格UserProfile表: (1)(2)

Or you could use your own existing data and map your users by ID or unique user name to the standard membership users. 或者,您可以使用自己的现有数据,并通过ID或唯一的用户名将用户映射到标准成员身份用户。 If you use this, keep in mind to keep it consistent (ie when handling users in your application). 如果使用此功能,请记住保持一致(即在处理应用程序中的用户时)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM