/// <summary> /// Shows the saved password after confirm the master password. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonShowPassword_Click(object sender, EventArgs e) { Passwordinput pin = new Passwordinput(); DialogResult res = pin.ShowDialog(); if (res == DialogResult.OK) { if (Password_helper.Check_password(pin._password)) { Passwordinput pinshow = new Passwordinput("drive", checkBoxPim.Checked, _password, _pim); DialogResult pinshowresult = pinshow.ShowDialog(); if (pinshowresult == DialogResult.OK) { _password = pinshow._password; _pim = pinshow._pim; buttonShowPassword.Enabled = true; } pinshow._password = null; pinshow._pim = null; pinshow.Dispose(); } else { DialogResult wrongres = MessageBox.Show(this, LanguagePool.GetInstance().GetString(LanguageRegion, "MessageMasterPasswordWrong", _language), "", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (wrongres == DialogResult.Retry) { buttonShowPassword_Click(sender, e); } } } }
private void buttonSavePassword_Click(object sender, EventArgs e) { Passwordinput pw = new Passwordinput(ConfigTrm.Container.Typename, checkBoxPim.Checked); DialogResult res = pw.ShowDialog(); if (res == DialogResult.OK) { _password = pw._password; _pim = pw._pim; buttonShowPassword.Enabled = true; } pw._password = null; pw._pim = null; pw.Dispose(); }