private void signin_button_Click(object sender, RoutedEventArgs e) { AUtils t = new AUtils(); AEncrypter encrypter = new AEncrypter(); encrypter.ReadKeyFile(); AStatic.StringKey = key_textBox.Text; if (encrypter.ValidKey(AStatic.StringKey)) { if (encrypter.DecryptFile(AStatic.DbPath)) { AStatic.IsRunning = true; t.ReadCatalog(); NavigationService.Navigate(new Uri("AHome.xaml", UriKind.Relative)); } } else { signinlabel.Content = FindResource("StrUid_wrongkey").ToString(); } }
private void done_button_Click(object sender, RoutedEventArgs e) { AEncrypter encrypter = new AEncrypter(); if (encrypter.ValidKey(oldkey_textBox.Text)) { if (newkey_textBox.Text == confirm_textBox.Text) { AStatic.StringKey = newkey_textBox.Text; encrypter.WriteKeyFile(newkey_textBox.Text); encrypter.ReadKeyFile(); } else { tiptextblock.Text = FindResource("StrUid_newkeynotequal").ToString(); } } else { tiptextblock.Text = FindResource("StrUid_oldkeywrong").ToString(); } }