private void pass3_TextChanged(object sender, EventArgs e) { if (p == 0) { Pass4.Focus(); } if (p == 1) { p = 0; } }
private void Pass4_TextChanged(object sender, EventArgs e) { if (pass1.Text == "" && Pass2.Text == "" & pass3.Text == "" && Pass4.Text == "") { label4.Visible = true; label4.Text = "Password is in complite !"; pass1.Clear(); Pass2.Clear(); pass3.Clear(); Pass4.Clear(); p = 0; pass1.Focus(); } else { if (con.State == ConnectionState.Closed) { con.Open(); } string a1 = pass1.Text.ToString() + Pass2.Text.ToString() + pass3.Text.ToString() + Pass4.Text.ToString(); SqlCommand cmd = new SqlCommand("Select Password from PasswordCheek", con); string Password = cmd.ExecuteScalar().ToString(); // MessageBox.Show("Data"+a1+ "get"+ Password); if (a1 == Password) { Dashboard ds = new Dashboard(); ds.Show(); this.Hide(); } else { label4.Text = "Password is Incorect ! "; pass1.Clear(); Pass2.Clear(); pass3.Clear(); Pass4.Clear(); p = 0; pass1.Focus(); } } }