private void Login_page()
{
var i = 0;
while (i < 5)
{
if (textBox1.Text.Equals("admin"))
{
if (textBox2.Text.Equals("parth"))
{
}
else
{
textBox1.ResetText();
MessageBox.Show("passwod is wrong try agine");
i++;
}
}
else
{
textBox2.ResetText();
MessageBox.Show("username and password is wrong");
i++;
}
}
if (i == 5)
{
MessageBox.Show("you tried max time");
Dispose();
}
else
{
MainMenu mainMenu = new MainMenu();
mainMenu.Show();
this.Hide();
}
}
I am tring for if inserted password and username is wrong so its give 5 time to change that but i have proble how to insert text next time in textbox. in this code loop is continusly insert blank text in textbox. so how to fix it??