private void SalvareSchimbari_Click(object sender, EventArgs e) { ManagerParole.SalveazaParolele(ManagerParole.LocatieFisier, ManagerParole.MainPassword); Properties.Settings.Default.caractereParola = ManagerParole.CaracterePermise; Properties.Settings.Default.lungimeParola = ManagerParole.LungimeParola; Properties.Settings.Default.Save(); }
private void Create_Click(object sender, System.EventArgs e) { MainPasswordForm PasswordForm = new MainPasswordForm(); PasswordForm.title = "Create a master password"; PasswordForm.ShowDialog(); if (ManagerParole.MainPassword.Length == 0) { return; } ManagerParole.AdaugaExemple(1); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = $"{ManagerParole.NumeProgram} files |*{ManagerParole.Extensie}"; saveFileDialog.DefaultExt = ManagerParole.Extensie; saveFileDialog.AddExtension = true; saveFileDialog.RestoreDirectory = true; if (saveFileDialog.ShowDialog() == DialogResult.OK) { ManagerParole.SalveazaParolele(saveFileDialog.FileName, ManagerParole.MainPassword); } }
private void okButton_Click(object sender, EventArgs e) { if (NewPassBox.Text != CNewPassBox.Text) { MessageBox.Show("The password is wrong in atleast one field!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (OldPassBox.Text == "" || NewPassBox.Text == "" || CNewPassBox.Text == "") { MessageBox.Show("One or more fields are empty!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (OldPassBox.Text != ManagerParole.MainPassword) { MessageBox.Show("Old password is wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { ManagerParole.SalveazaParolele(ManagerParole.LocatieFisier, NewPassBox.Text); ManagerParole.MainPassword = NewPassBox.Text; MessageBox.Show("Password was changed succesfuly!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } }