如何在asp.net中设置登录密码安全性? [英] How to set a Login Password security in asp.net?

查看:127
本文介绍了如何在asp.net中设置登录密码安全性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户输入错误密码三次时,其用户名和密码将被阻止..如何在asp.net和c#中设置此条件?

when a user enter wrong password in three times its username and password will be blocked..how to set this condition in asp.net and c#?

推荐答案

制作一个布尔字段(例如阻止),表示在您存储用户的数据库表中被阻止或未被阻止的帐户,并将其设置为0或false。



现在每当用户尝试尝试登录检查它是否被阻止。如果它被阻止,只需返回你想要的任何东西。



现在登录时创建一个查询字符串变量,例如:调用try并将其设置为0(尝试使用错误的paassword登录facebook并查看)。每当用户输入错误的密码或用户名时!增加查询字符串中的尝试变量。当尝试变量达到3时,将阻止字段设置为true或1.现在当用户再次尝试登录时,显示您的帐户被阻止的消息。
make a boolean field (e.g. blocked) that represent the account blocked or not in database table in which you store the users and set it to 0 or false.

now whenever a user try to attempt login check it is blocked or not. if it is blocked just return whatever you want.

now for login make a query string variable e.g. called attempt and set it to 0(try to login on facebook with wrong paassword and see). whenever a user enters the wrong password or user name! increament the attempt variable in query string. when attempt variable reaches to 3 set the blocked field to true or 1. and now when user try to login again show the message that your account is blocked.


这篇关于如何在asp.net中设置登录密码安全性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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