예제 #1
0
        private void btn_signIn_Click(object sender, RoutedEventArgs e)
        {
            var user = people.Where(i => i.Login == txt_login.Text && i.Password == txt_password.Text).FirstOrDefault();

            if (user != null && truecapcha == false)
            {
                if (chek_save.IsChecked == true)
                {
                    using (StreamWriter streamWriter = new StreamWriter(path))
                    {
                        streamWriter.WriteLine(user.Login + " " + user.Password);
                    }
                }

                HelloWindow helloWindow = new HelloWindow(user);
                helloWindow.ShowDialog();
            }

            else if (user != null && truecapcha == true)
            {
                if (tb_capcha.Text == txt_capcha_enter.Text)
                {
                    HelloWindow helloWindow = new HelloWindow(user);
                    helloWindow.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Неправильно введена Капча");
                    tb_capcha.Text = GetString.CapchaAct();
                }
            }

            else
            {
                if (flag >= 2)
                {
                    truecapcha                  = true;
                    btn_reload.Visibility       = Visibility.Visible;
                    tb_capcha.Visibility        = Visibility.Visible;
                    tb_capcha_text.Visibility   = Visibility.Visible;
                    txt_capcha_enter.Visibility = Visibility.Visible;
                    tb_capcha.Text              = GetString.CapchaAct();
                }
                MessageBox.Show("Пользователь не найден");
                flag += 1;
            }
        }
예제 #2
0
 private void btn_reload_Click(object sender, RoutedEventArgs e)
 {
     tb_capcha.Text = GetString.CapchaAct();
 }