Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to verify whether the account password is correct to log in through Web.config in ASP.NET

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report