private void confirm_Click(object sender, EventArgs e) { if (mng.EditPassword(currentpassword.Text, newpassword.Text, confirmpassword.Text) == 2) { FileStream file = File.Create("Uni"); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(file, Universal.instance); file.Close(); ManagerPanel managerpanel = new ManagerPanel(id); managerpanel.Show(); this.Hide(); } else if (mng.EditPassword(currentpassword.Text, newpassword.Text, confirmpassword.Text) == 1) { errorProvider2.SetError(confirmpassword, "تکرار رمز عبور صحیح نیست"); } else { errorProvider1.SetError(currentpassword, "رمز عبور اشتباه است"); } }