在asp.net中尝试三次用户后如何进行限制 [英] How to restrict after three times attempted user in asp.net

查看:84
本文介绍了在asp.net中尝试三次用户后如何进行限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想限制登录了三次以上的用户.我该怎么做.

I want to restrict user who has login more then three time how can i do this.

推荐答案


你好,

在您的登录表中添加一列,即LoginAttempt.

1)更新登录存储过程/查询中的LoginAttempted值.
2)成功登录后,重置为0(零).
3)在每次登录时,您都可以检查LoginAttempted列值并对其执行特定操作.喜欢限制他或给他一些信息.

希望对您有帮助,
谢谢
-amit.
Hi,

Add one column in your login table i.e. LoginAttempt.

1) Update LoginAttempted value in login stored procedure / query.
2) After successful login , reset to 0(zero).
3) on each login you can check LoginAttempted column value and do particular action on it. like restrict him or give him some message.

hope this will help you,
thanks
-amit.


您有两个选择;

1.无论使用ASP.net成员资格提供程序类,都具有默认实现的功能,该功能可在某些失败的登录尝试后锁定用户.

2.将数据类型为boolean的cloumn"IsLockedOut"添加到您的用户表中,并且当用户尝试登录时,仅计算未成功登录的尝试次数.当计数为3时,将表中的该特定用户的IslockedOut列设置为"true".因此,即使该用户尝试使用正确的凭据登录,他也将无法登录.因此,当用户登录时,您将必须在逻辑中检查用户名",密码"和"IsLockedOut".

如果IsLockedOut标志为false,则在用户名和密码正确的情况下允许用户登录,否则即使其他凭据正确也拒绝用户登录.
There are two option with you;

1. Either use a ASP.net membership provider class it has a default functionality implemented which locks he users after a certain unsuccessfull login attempts.

2. Add a cloumn"IsLockedOut" of datatype boolean ,to your user table and while a user attemts to login just count the number of attempts if its a unsucessfull login. When the count gets 3 set IslockedOut column in the table to "true" for that particular user.So even if the user tries to login with correct credentials he wont able to login. So when a user login you will have to check "Username","Password" and "IsLockedOut" in your logic.

If the IsLockedOut flag is false then allow the user to login if his username and password is correct else deny him to login even if other credentials are correct.


这篇关于在asp.net中尝试三次用户后如何进行限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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