Login
Friends,
I have written a code like this.I have to restrict the user from entering the wrong username/password more than three times. how to do this with modifying the below given code????
************************************************** **********
private void Login_Click(object sender, System.EventArgs e)
{
int count=0;
if(TextBox1.Text.ToString()== "a" && TextBox2.Text.ToString()== "b")
{
Label1.Text="Successful";
}
else if(TextBox1.Text.ToString()!="a" || TextBox2.Text.ToString()!="b" )
{
count+=1;
Label1.Text="Failed";
Label2.Text=count.ToString();
}
if(count >= 3 )
{
Label1.Text="Exceeds the attemt";
}
}
}
************************************************** ************
Thanks....
__________________
sumith
|