本文介绍了在vb.net代码中进行3次无效登录尝试后如何限制用户30分钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在vb.net代码中进行3次无效登录尝试后,如何限制用户30分钟

how to restrict user for 30 minutes, after 3 invalid login attempts in vb.net code

推荐答案


Username VARCHAR(255),
Occurred DATETIME



以下SQL将给您失败的登录计数.



The the following SQL will give you the failed login count.

SELECT [Count] = COUNT(*) FROM dbo.FailedAttempts WHERE Username=@Username AND Occurred > DATEADD(MINUTE, -30, GETDATE())



然后,您需要将其构建到登录过程中,以便在用户登录失败时将其插入失败的尝试表中.如果密码有效,则检查当前失败尝试次数,并在密码尝试次数过高时拒绝尝试.



You then need to build this into you login process so that if the user login fails you insert into the failed attempts table. If the password is valid you check the current failed attempts count and reject their attempt where it''s too high.


这篇关于在vb.net代码中进行3次无效登录尝试后如何限制用户30分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 17:31