Пример #1
0
        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);
            }
        }
Пример #2
0
 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();
 }
Пример #3
0
        private void Load_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = $"{ManagerParole.NumeProgram} files |*{ManagerParole.Extensie}";
            openFileDialog.RestoreDirectory = true;

            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            ManagerParole.LocatieFisier = openFileDialog.FileName;
            MainPasswordForm PasswordForm = new MainPasswordForm();

            PasswordForm.title = "Enter you master password";
            PasswordForm.ShowDialog();
            if (ManagerParole.MainPassword.Length == 0)
            {
                return;
            }
            if (ManagerParole.CitesteConturi(ManagerParole.LocatieFisier, ManagerParole.MainPassword))
            {
                this.Close();
                Program.CorrectPassword = true;
            }
            else
            {
                if (ManagerParole.MainPassword.Length != 0)
                {
                    MessageBox.Show("Password is wrong!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Пример #4
0
 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();
     }
 }
Пример #5
0
 private void GenButton_Click(object sender, EventArgs e)
 {
     passBox.Text = ManagerParole.RandomString(ManagerParole.LungimeParola);
 }