private void smenu_pass_Click(object sender, EventArgs e) { PassBox db = new PassBox(); db.Text = "Введите старый пароль"; db.ShowDialog(); if (db.DialogResult == DialogResult.OK) { if (db.Description == Properties.Settings.Default.Pass) { PassBox newdb = new PassBox(); newdb.Text = "Введите новый пароль"; newdb.ShowDialog(); if (newdb.DialogResult == DialogResult.OK) { if (newdb.Description.Trim() != "") { Properties.Settings.Default.Pass = newdb.Description; Properties.Settings.Default.Save(); } } } else { MessageBox.Show("Неверный пароль"); } } }
private void toolStripButton2_CheckedChanged(object sender, EventArgs e) { PassBox db = new PassBox(); db.ShowDialog(); if (db.DialogResult == DialogResult.OK) { if (db.Description == Properties.Settings.Default.Pass) { Properties.Settings.Default.AllowViews = toolStripButton2.Checked; Properties.Settings.Default.Save(); RefreshMenu(); } else { MessageBox.Show("Неверный пароль"); } } }
private void smenu_pass_Click(object sender, EventArgs e) { PassBox db = new PassBox(); db.Text = "Введите старый пароль"; db.ShowDialog(); if (db.DialogResult == DialogResult.OK) { if (db.Description == Properties.Settings.Default.Pass) { PassBox newdb = new PassBox(); newdb.Text = "Введите новый пароль"; newdb.ShowDialog(); if (newdb.DialogResult == DialogResult.OK) { if (newdb.Description.Trim()!="") { Properties.Settings.Default.Pass = newdb.Description; Properties.Settings.Default.Save(); } } } else { MessageBox.Show("Неверный пароль"); } } }