如何限制asp.net的登录时间 [英] how to limit login time asp.net

查看:161
本文介绍了如何限制asp.net的登录时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁可以告诉我限制用户登录时间的方式,如果用户登录同时失败3次,则他的acc将被阻止!

who can tell me the way limit login time of user, if user login failed three times on same time then him acc will bi block!

推荐答案

我怎么办建议您保留一个具有最大阈值登录尝试次数的webconfig应用设置键.首次登录登录页面时,创建一个会话变量,其值保留为0.如果连续尝试登录失败,请增加会话值并使用应用程序设置键检查最大阈值,然后在数据库中阻止用户.

如果您希望根据时间限制时间,可以参考以下链接

http://stackoverflow.com/questions/355602/locking-out-a-user-in-an-asp-net-custom-membership-provider [
What i would suggest is that keep a webconfig app settings key that has the max threshold login attempt count. When you land the login page(for the first time) create a session variable that holds value as 0 . On successive login failed attempts, increase the session value and check for the max threshold using the app setting key, then block the user in the database.

If you want this to limit based on the time, you could refer the below link

http://stackoverflow.com/questions/355602/locking-out-a-user-in-an-asp-net-custom-membership-provider[^]

In membership you have two properties

maxInvalidPasswordAttempts
passwordAttemptWindow

You can use them.


请参阅这可能对您有帮助

http://asp.net.bigresource.com/add-features-in-login-page-Only-allow-user-to-times-attempts-CzHWPHyrO.html [
Refer this may help you

http://asp.net.bigresource.com/add-features-in-login-page-Only-allow-user-to-three-times-attempts-CzHWPHyrO.html[^]


这篇关于如何限制asp.net的登录时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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