Example #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Login lo = new Login
            {
                Log  = textBox.Text,
                Pass = passwordBox1.Password
            };

            db d = new db();

            if (Validate.Valid(lo))
            {
                if (d.Sign_in(lo.Log, lo.Pass))
                {
                    Start a = new Start();
                    NavigationService.Navigate(a);
                    textBox.Text = "";
                }
                else
                {
                    label2.Content        = "Введен неверный логин или пароль";
                    textBox.Text          = "";
                    passwordBox1.Password = "";
                }
            }
        }
Example #2
0
        private void button_Click_1(object sender, RoutedEventArgs e)
        {
            db         a  = new db();
            UpdatePass up = new UpdatePass
            {
                Password    = pass1.Password,
                NewPassword = pass2.Password
            };

            a.A();
            string     login    = db.Login;
            SaltedHash password = new SaltedHash(up.Password);
            string     salt     = password.Salt;
            string     hash     = password.Hash;

            if (Validate.Valid(up))
            {
                if (a.Sign_in(login, up.Password))
                {
                    a.UpdatePass(salt, hash);
                    MessageBox.Show("Пароль изменен");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Вы ввели неверный пароль!");
                    pass1.Password = "";
                    pass2.Password = "";
                }
            }
        }
Example #3
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            db re = new db();

            RemovePass remove = new RemovePass
            {
                Password = passwordBox1.Password
            };

            if (Validate.Valid(remove))
            {
                if (re.Sign_in(db.Login, remove.Password))
                {
                    re.A();
                    re.RemoveTicket();
                    re.RemovePass();
                    db.Login = "";
                    db.Name  = "";
                    MessageBox.Show("Аккаунт удален");
                    Page1 start = new Page1();
                    NavigationService.Navigate(start);
                }
                else
                {
                    passwordBox1.Password = "";
                }
                pass1.Content = "Неверные данные";
            }
        }