Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }