private void btnSign_Click(object sender, RoutedEventArgs e) { var user = people.Where(i => i.Login == tbLog.Text && i.Password == tbPass.Text).FirstOrDefault(); if (user != null && !truecapcha) { if (chbRememb.IsChecked == true) { using (StreamWriter streamWriter = new StreamWriter(path)) { streamWriter.Write(tbLog.Text + " " + tbPass.Text); streamWriter.Close(); } } WindowSing windowSing = new WindowSing(user); windowSing.ShowDialog(); } else if (user != null && truecapcha) { if (txtCapch.Text == tbCapch.Text) { WindowSing windowSing = new WindowSing(user); windowSing.ShowDialog(); } } else { MessageBox.Show("Пользователь не найден."); txtCapch.Text = GetString.GetCapcha(); tbCapch.Visibility = Visibility.Visible; txtCapch1.Visibility = Visibility.Visible; txtCapch.Visibility = Visibility.Visible; imgCapcha.Visibility = Visibility.Visible; btnCapch.Visibility = Visibility.Visible; truecapcha = true; } }
private void btnCapch_Click(object sender, RoutedEventArgs e) { txtCapch.Text = GetString.GetCapcha(); }