private void button1_Click(object sender, EventArgs e) { if (usrTxt.Text.Length < 3 || passTxt.Text.Length < 5) { MessageBox.Show("Falscher Benutzername oder Passwort"); regform reg = new regform(); reg.Show(); } else { string dir = usrTxt.Text; User usr = new User(); string encusr = usr.benutzername; string encpass = usr.passwort; bool recht = usr.recht; string decusr = AesCryp.Decrypt(encusr); string decpass = AesCryp.Decrypt(encpass); if (decusr == usrTxt.Text && decpass == passTxt.Text) { MessageBox.Show("Welcome {0} to the private area!", decusr); main main = new main(); main.Show(); } else { MessageBox.Show("Error user or password is wrong!"); } } }
private void button1_Click(object sender, EventArgs e) { regform rf = new regform(); rf.Show(); }