ASP.NET SQLMembershipProvider - 电子邮件作为用户名

发布于 2024-07-14 18:37:52 字数 240 浏览 4 评论 0原文

我即将开始构建一个新的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

誰ツ都不明白 2024-07-21 18:37:52

您无需更改提供程序中的任何内容。 只需在注册时将电子邮件设置为用户名,并且不在 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.

向日葵 2024-07-21 18:37:52

您可以修改程序...或者只是省略表单/用户界面中的电子邮件或用户名字段,并在幕后使用其中一个或另一个来填充另一个字段。 这可能是重复的数据,但您可能会发现需要一个不是用户名的电子邮件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文