private void Button1_Click(object sender, EventArgs e) { this.Close(); ProdusNou s = new ProdusNou(); s.Show(); }
private void LogIn_Click(object sender, EventArgs e) { FileStream fs = new FileStream("administrator.txt", FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs); string text = sr.ReadToEnd(); string[] substr = Regex.Split(text, " "); int i = 0; bool ok = true; while (ok == true && i < substr.Length) { if (tb_username.Text == substr[i] && tb_pw.Text == substr[i + 1]) { ok = false; } i = i + 2; } if (ok == false) { this.Hide(); ProdusNou a = new ProdusNou(); a.Show(); } else { MessageBox.Show("Logare incorecta"); } GC.Collect(); }