如何在asp Dot Net中停用用户? [英] How can i Deactivate the user In asp Dot Net?
本文介绍了如何在asp Dot Net中停用用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个应用程序如果用户尝试登录您的帐户,如果用户失败了3次,我想要做这样的事情。用户帐户24小时后已停用24小时后自动激活。我希望在不使用Asp .net ....的登录控件的情况下实现此概念。
I am creating an application In Which I am wanting to do something like this if user try to login in ur account if user failed for 3 times. the user account has been deactivated for 24 hours after 24 hours its automatically activate.i want to implement this concept without using Login Controls of Asp .net....
推荐答案
//如果用户登录失败,请输入此代码...在您的其他部分
//Put this code if login failed for user... in your else part
if (Session["Count"] != null)
{
if (Session["Count"].ToString() != "3")
{
Session["Count"] = Convert.ToInt32(Session["Count"].ToString()) + 1;
}
else
{
Session.Remove("Count");
//insert into db to update lock status of user
}
}
else
{
Session["Count"] = "1";
}
这篇关于如何在asp Dot Net中停用用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文