ASP.NET SQLMembershipProvider-作为用户名的电子邮件 [英] ASP.NET SQLMembershipProvider - email as username

查看:72
本文介绍了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.

推荐答案

您无需在提供程序中进行任何更改.只需在注册时将电子邮件设置为用户名,并且用户界面中没有提供任何更改电子邮件地址的方法.它将轻松完成工作.

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.

这篇关于ASP.NET SQLMembershipProvider-作为用户名的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆