3次失败的登录尝试 [英] 3 failed login attempts

查看:74
本文介绍了3次失败的登录尝试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个ASP.NET 4.0 C#网站.我正在跟踪失败的登录尝试. 3点以后,我锁定帐户.我正在使用数据库来跟踪无效的登录尝试.如果用户连续输入3次错误尝试,我就可以正常工作.我的问题是,如果他们只有2次失败尝试,我需要在下一个用户尝试登录之前删除数据库中的信息,如果我没有这样做,并且他们只有1次失败尝试,它们将被锁定.我尝试使用if!IsPostBack on页面加载,但是显然单击使用户返回登录页面的链接不是回发.任何想法或建议将不胜感激.

谢谢,
D

Hi All, I have an ASP.NET 4.0 C# site. I am tracking failed log in attempts. After 3 I lock account. I am using a database to keep track of invalid login attempts. I got it to work if user enters 3 bad attempts in a row. My problem is if they only have 2 failed attempts, I need to delete info in database before next user tries to log in, if I don''t and they have just 1 failed attempt they will be locked out. I tried using if !IsPostBack on Page load, but apparently clicking on a link that brings user back to log in page is NOT a postback. Any ideas or suggestions would be greatly appreciated.

Thanks,
D

推荐答案

很简单,当用户成功登录时,只需在该过程中添加逻辑即可将该字段设置回0.
Very simple, when a user successfully logs in, just add the logic to that process which sets that field back to 0.


在您的代码中,如果用户成功登录,请添加代码以重置用户的计数.并且每次用户成功登录后,无论登录多少次失败,都必须重置其计数.
In your code, where user gets successful login, add code which resets the count back for the user. and every time a user successfully logins, its count must be reset, no matter how many times he failed to login.


这篇关于3次失败的登录尝试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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