How to verify whether the account password is correct to log in through Web.config in ASP.NET
In this issue, the editor will bring you about how ASP.NET uses Web.config to verify whether the account password is correct to log in. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
Throw a question
Two accounts are required. One account is admin. Password: 123.
The other account is guest with a password of 1234
Anonymous users and login with account guest are not allowed.
Code implementation
? Is not logged in user (anonymous user) * is all users
What kind of user access is denied by deny?
What kind of users are allowed to access allow?
Login in the background (aspx.cs)
Using System.Web.Security
If (FormsAuthentication.Authenticate (this.TextBox1.Text, this.TextBox2.Text)) / / check whether there is an authenticated user {FormsAuthentication.RedirectFromLoginPage (this.TextBox1.Text, true) in the configuration file; / / Save cookie and open the address you want to go}
Such an outdated login is complete.
This is how ASP.NET uses Web.config to verify whether the account password is correct to log in. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.