Ejemplo n.º 1
0
 private void submit_password_phrase_Click(object sender, EventArgs e)
 {
     if ((textBox_passwordPhrase.Text == null) || !textBox_passwordPhrase.Text.Any(x => char.IsLetter(x)) || !textBox_passwordPhrase.Text.Any(x => char.IsDigit(x)))
     {
         MessageBox.Show("Password phrase is empty!!!");
     }
     else
     {
         passwordPhraseValue = textBox_passwordPhrase.Text;
     }
     EncryptUserInfo.CreateValue(passwordPhraseValue);
 }
Ejemplo n.º 2
0
        private void OnApplicationExit(object sender, EventArgs e)
        {
            UserContext     db  = new UserContext();
            UserCopyContext dbc = new UserCopyContext();

            foreach (var user_ in db.UserList)
            {
                db.UserList.Remove(user_);
            }
            db.SaveChanges();
            foreach (var user in dbc.Users)
            {
                db.UserList.Add(user);
            }
            db.SaveChanges();
            EncryptUserInfo.EncryptFile("users.mdf");
        }