ASP.NET SQLMembershipProvider - 电子邮件作为用户名
我即将开始构建一个新的 asp.net 项目,并且我刚刚开始处理 SQLMembershipProvider 的全部内容。 我真正想做的是消除对用户名的需要,只将用户的密钥作为电子邮件地址。
在我看来,最简单的事情可能是更改存储过程以从表中删除电子邮件地址,并且当有人通过电子邮件进行搜索时,只需使用密钥(我还需要处理有人更改其电子邮件地址...
在我开始之前,有人知道那里有一个预先推出的示例吗?它似乎太常见了,无法构建它。
I'm about to start building a new asp.net project, and I'm just starting out with the whole thing of SQLMembershipProvider. What I really want to do is to remove the need for a username and just have the key to the user as the email address.
It seems to me that the easiest thing might be to change the stored procedures to just remove the email address from the tables, and when someone does a search by email, just to use the key (I also need to deal with someone changing their email address...
Before I start, does anyone know a pre-rolled example out there. It just seems too common to have to build it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无需更改提供程序中的任何内容。 只需在注册时将电子邮件设置为用户名,并且不在 UI 中提供任何更改电子邮件地址的方法。 它会轻松完成工作。
You don't need to change anything in the provider. Just set the email as user name upon registration and don't provide any means in the UI to change the email address. It'll do the work easily.
您可以修改程序...或者只是省略表单/用户界面中的电子邮件或用户名字段,并在幕后使用其中一个或另一个来填充另一个字段。 这可能是重复的数据,但您可能会发现需要一个不是用户名的电子邮件。
You could modify the procedures... or just omit the email or username fields in your forms/ui and use one or the other behind the scenes to populate the other field. This might be duplicate data, but you might find a need to have an email that isn't also the username down the road.