Today, manyWeb2.0All websites useEmailAs the logon username, the address has the following advantages:
1.It is not easy to repeat. The user names are often repeated, causing users to have to use different user names between multiple websites, which is difficult to remember and manage.EmailThe address is unique.
2.Easy to remember. Frequently UsedEmailGenerally, there are no more than three addresses, so even if you forget which one is, you can try it out quickly.
3.Not easy to crack. The user name is usually visible to everyone on the website. This will lead some people with ulterior motives to pay attention to a specific user and defraud or brute force crack the account.EmailThe address is usually kept confidential on the website.EmailBefore the address is cracked, the account security is greatly improved.
Some websites use user names,EmailAddresses can all be logged on, which is more secure than the user name./Password Logon is easier, but more convenient for users. It is only applicable to websites that do not matter account security.
InASP. NETIn the Custom User Management SolutionEmailLogin is simple, and everything is under your control.
IntegrationMembershipAndASP. Network 2.0The implementation scheme of the logon control has not been found on the InternetArticleIt should be very simple:
1.Customize the logon control template and change the "user name" label to "email address ":
2.AddAuthenticateEvent proxy, in which custom verification is performed.E. authenticatedSetTrue:
However, it is okay to log on in this way, but it will be displayedEmailAddress, callPage. User. Identity. NameAttribute.EmailAddress, Which is awkward and inconvenient.
And even if it is reset in Event ProcessingLogin1.usernameIsEmailThe corresponding user name does not help.
After research, I found a more appropriate method, that is, throughFormsauthenticationClass self-implemented login:
Protected Void login1_authenticate (ObjectSender,AuthenticateeventargsE)
{
VaRName= Membership.Getusernamebyemail (login1.Username );
If(Membership.Validateuser (name, login1.Password ))Formsauthentication.Redirectfromloginpage (name, login1.Remembermeset );
}
In this way, the above problems can be solved perfectly and we recommend that you use them.
Download the PDF version of this article: http://www.box.net/shared/0bhfud0qjz