希望在现有网站上实施会员 API
我有一个现有的 ASP.NET Web 应用程序供公共使用,任何匿名用户都可以访问它。我想实施用户注册机制。我首先想到的是使用 ASP.NET 会员 API。
那么,如果我使用会员 API:
- 我可以将其与现有的 API 集成吗? SQL Express 数据库?我宁愿 没有两个单独的数据库
- 我可以选择不使用 GUID 用户 ID?
- 我可以只安装需要的桌子吗 让会员制发挥作用?我不会 想要有 WebPart 的表格 因为这个网站永远不会有 Web 部件。
- 匿名用户仍将拥有 访问所有页面(我可能 但限制功能)。我可以做吗 我可以追踪这个吗 匿名用户?
- 我可以自定义创建用户吗 账户控制没有安全性 问题和答案?
非常感谢有关会员 API 的任何有用的视频教程
I have an existing ASP.NET web application that is for public use and any anonymous user can access it. I would like to implement mechanism for users to sign up. The first thought that crossed my mind is to use the ASP.NET membership API.
So, If I use the Membership API:
- Can I integrate it with an existing
SQL express database? I would rather
not have two separate databases - Can I choose not to have GUIDs for
User IDs? - Can I install only the tables needed
for Membership to work? I would not
want to have tables for say WebParts
as this website will never have
WebParts. - Anonymous users will still have
access to all the pages (I might
limit the features though). Can I do
this and can I somehow track
anonymous users? - Can I customize the create user
account control to not have security
question and answer?
Any useful video tutorials on membership api is really appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1) 是的,您可以集成现有数据库。请参阅
此处
。这将创建使用 API 所需的所有成员资格表和存储过程。2)您可以使用任何您想要的ID。通常,如果它不是 GUID,那么它就是递增的 INT。
3) 上面链接中的工具安装所需的表。 AFAIK,该安装中没有 Web 部件表,但这可能需要确认。
4) 您可以允许匿名用户访问您喜欢的任何区域。您可以通过 web.config 中的
authorization
属性来设置限制文件。要跟踪匿名用户,这篇
是一篇相当不错的文章。5) 您可以根据自己的喜好自定义用户帐户。如果您想删除安全问题和答案部分,则可以。需要一些配置,但在
ASP.NET
< 上有一些教程/a> 和4GuysFromRolla
。您可以使用自定义提供程序,如 CodeToGlory 提到的那样。看看什么最适合您。但是,不要忘记
在开始任一方法之前备份数据库
,以防出现问题:)1) Yes, you can integrate an existing database. See
here
. This will create all the Membership tables and stored procedures required to use the API.2) You can use whatever ID you want. Usually, if it's not a GUID, it's an incrementing INT.
3) The tool in the link above installs the required tables. AFAIK, there are no tables for Web Parts in that installation, but that may need confirming.
4) You can allow anonymous users to access whatever areas you like. You can place restrictions via the
authorization
attribute in the web.config file. To track anonymous users,this
is quite a good article.5) You can customize the user account to however you like. If you want to remove the Security Question and Answer section, you can. Requires a bit of configuration, but there's some tutorials over at
ASP.NET
and4GuysFromRolla
.You could use a custom provider instead as CodeToGlory mentioned. See what would suit you best. But, don't forget to
make a backup of your database before starting either methods
, just incase something goes wrong :)您应该考虑构建自定义提供程序。
这是一个很好的视频教程,可帮助您入门
http://www.asp.net/%28S%28ywiyuluxr3qb2dfva1z5lgeg%29%29/learn/videos/video-189.aspx
You should look into building custom providers.
Here is one good video tutorial to get you started
http://www.asp.net/%28S%28ywiyuluxr3qb2dfva1z5lgeg%29%29/learn/videos/video-189.aspx