Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (text1.Text != "" && text2.Text != "" && text3.Text != "")
     {
         if (text1.Text == text2.Text)
         {
             string EnterPas;
             EnterPas = b.ReadFromFile();
             if (b.Encode(text3.Text, Class1.Key) == EnterPas)
             {
                 string EncodePas;
                 Class1.Key = b.GenKey();
                 EncodePas  = b.Encode(text1.Text, Class1.Key);
                 b.WriteInFile(EncodePas);
                 this.Hide();
                 vivod_key vivod_key = new vivod_key();
                 vivod_key.ShowDialog();
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Старый пароль введен неверно!");
             }
         }
         else
         {
             MessageBox.Show("Пароли не совпадают!");
         }
     }
     else
     {
         MessageBox.Show("Поля не могут быть пустыми!");
     }
 }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     Class1.Pas = password.Text;
     if (!(File.Exists("\\qwerty.txt")))
     {
         string EncodePas;
         Class1.Key = b.GenKey();
         EncodePas  = b.Encode(password.Text, Class1.Key);
         b.WriteInFile(EncodePas);
         this.Hide();
         vivod_key vivod_key = new vivod_key();
         vivod_key.ShowDialog();
         this.Close();
     }
     else
     {
         vvod_key vvod_k = new vvod_key();
         this.Hide();
         vvod_k.ShowDialog();
         this.Close();
     }
 }