如何使用3错误的密码使用C#终止asp.net中的登录页面 [英] how to terminate login page in asp.net using c# for 3 wrong password
本文介绍了如何使用3错误的密码使用C#终止asp.net中的登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c#终止3个错误密码的情况下使用c#终止asp.net中的登录页面
how to terminate login page in asp.net using c# for 3 wrong password
推荐答案
没有直接的方法
您必须采取解决方法
1)在数据库中创建一个表,其字段为Blockloginpage(布尔数据类型)
2)在此表中插入0
3)如果发现三个错误的密码,则将该表更新为1
4)检查此表中的值是否为1,然后以适当的msg显示其他页面.
如果有帮助,请接受并投票回答
--Rahul D.
there is no direct way of doing this
you have to do workaround
1)Create one table in database with field as Blockloginpage (boolean datatype)
2)Insert 0 in this table
3)then update this table for 1 if three atempt of wrong password found
4)check the value in this table if this is 1 then do display other page with proper msg.
If this helps then accept and vote the answer
--Rahul D.
苏雷什,
你可以试试这个
Hi Suresh,
you can try this
static int intCounter = 0;
intCounter = intCounter + 1;
textBox1.Text = "";
textBox2.Text = "";
textBox2.Text = "*";
if ((intCounter < 3))
{
if ((textBox2.Text == "password" && textBox2.Text == "User"))
{
MessageBox.Show("User name and password are correct");
}
else
{
str = Convert.ToString(3 - intCounter);
MessageBox.Show("User name or password incorrect! You have " + str + " tries left.");
}
}
else
{
MessageBox.Show("User name or password incorrect! You have no attempts remaining and the system is locked.");
Application.Exit();
}
这篇关于如何使用3错误的密码使用C#终止asp.net中的登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文