private void StartResolve() { if (string.IsNullOrEmpty(UserTextBox.Text)) { MessageBox.Show("You must enter a search term.", "Missing Search Term", MessageBoxButton.OK); UserTextBox.Focus(); return; } try { this.Cursor = Cursors.Wait; PeopleSoapClient ps = new PeopleSoapClient(); ps.Endpoint.Address = new System.ServiceModel.EndpointAddress(Utils.GetSiteUrl() + "/_vti_bin/People.asmx"); ps.SearchPrincipalsCompleted += new EventHandler <SearchPrincipalsCompletedEventArgs>(ps_SearchPrincipalsCompleted); ps.SearchPrincipalsAsync(UserTextBox.Text, 50, SPPrincipalType.User); } catch (Exception ex) { MessageBox.Show("There was a problem executing the search; please try again " + "later.", "Search Error", MessageBoxButton.OK); this.Cursor = Cursors.Arrow; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { ServerTextBox.Text = Properties.Settings.Default.Server; if (ServerTextBox.Text != "") { UserTextBox.Focus(); } }
private void UserCueText_Click(object sender, EventArgs e) { if (UserTextBox.Text.Trim() == "") { UserCueText.Hide(); } else if (UserTextBox.Text.Trim() != "" && UserCueText.Visible == false) { UserCueText.Hide(); } UserTextBox.Focus(); }
private void SetupFocus() { if (string.IsNullOrEmpty(ViewModel.Username)) { UserTextBox.Focus(FocusState.Programmatic); } else if (string.IsNullOrEmpty(ViewModel.Host)) { HostTextBox.Focus(FocusState.Programmatic); } else { Focus(FocusState.Programmatic); } }
private void SetupFocus() { SshProfileViewModel vm = (SshProfileViewModel)DataContext; if (string.IsNullOrEmpty(vm.Username)) { UserTextBox.Focus(FocusState.Programmatic); } else if (string.IsNullOrEmpty(vm.Host)) { HostTextBox.Focus(FocusState.Programmatic); } else { Focus(FocusState.Programmatic); } }
private void UserNotFound() { intentos++; if (intentos <= 3) { MessageBox.Show("Usuario(ID) o Contraseña incorrectos.", "Credenciales Inválidos", MessageBoxButtons.OK, MessageBoxIcon.Error); UserTextBox.Focus(); } else { if (intentos > 3) { MessageBox.Show("Ha excedido el limites de intentos para acceder al sistema", "Sistema Bloqueado", MessageBoxButtons.OK, MessageBoxIcon.Warning); Application.Exit(); } } }
private void Button_Click(object sender, RoutedEventArgs e) { SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=myDatabase;Integrated Security=True"); SqlCommand com = new SqlCommand(); int i = 0; try { if ((UserTextBox.Text == string.Empty) || (PassTextBox1.Text == string.Empty)) { MessageBox.Show("Please enter a User Name and a Password", "Error", MessageBoxButton.OK, MessageBoxImage.Error); UserTextBox.Focus(); return; } com = new SqlCommand("SELECT COUNT(*) FROM Table_1 WHERE UserName='******' AND Password='******' AND Active='" + true + "'", con); if (con.State == ConnectionState.Closed) { con.Open(); i = (int)com.ExecuteScalar(); } con.Close(); if (i > 0) { MessageBox.Show("Login Successfull", "", MessageBoxButton.OK, MessageBoxImage.Information); this.Hide(); } else { MessageBox.Show("Incorrect User Name or Password", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } UserTextBox.Text = ""; PassTextBox1.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { i = 0; con.Close(); } }
private async void Authenticate(Client tentativeClient) { ErrorMessage.Text = ""; Client authClient = await ClientAPI.Auth(tentativeClient); if (authClient != null) { // set as active client and change panel ActiveClient = authClient; ChangeActivePanel(MainForm.Panel.Home); } else { ErrorMessage.Text = "Informations de connexion erronées."; UserTextBox.Text = ""; PasswordTextBox.Text = ""; UserTextBox.Focus(); } }
private async void AuthorizeButton_Click(object sender, RoutedEventArgs e) { if (!(DataContext is GfycatPreset preset)) { return; } if (string.IsNullOrWhiteSpace(UserTextBox.Text) || PasswordTextBox.SecurePassword.Length < 1) { StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.Credentials")); return; } try { ThisPanel.IsEnabled = false; StatusBand.Hide(); //When in authenticated mode, the user must authorize the app by using the username and password. if (await Gfycat.GetTokens(preset, UserTextBox.Text, PasswordTextBox.Password)) { StatusBand.Info(LocalizationHelper.Get("S.Options.Upload.Preset.Info.Authorized")); UserTextBox.Clear(); PasswordTextBox.Clear(); return; } StatusBand.Warning(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.AuthError")); UserTextBox.Focus(); } catch (Exception ex) { LogWriter.Log(ex, "Authorizing access - Gfycat"); StatusBand.Error(LocalizationHelper.Get("S.Options.Upload.Preset.Warning.AuthError"), () => new ExceptionViewer(ex).ShowDialog()); UserTextBox.Focus(); } finally { ThisPanel.IsEnabled = true; } }
private void LoginBtn_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=PHONEANDMORE;Integrated Security=True"); conn.Open(); SqlCommand SelectUsername = new SqlCommand("select Type from Creds where UserName = '******'and Password ='******'", conn); SqlDataReader UserReader; UserReader = SelectUsername.ExecuteReader(); if (UserReader.Read() == true) { if (UserReader[0].ToString() == "admin" || UserReader[0].ToString() == "user") { MainMenu ah = new MainMenu(); ah.get(UserTextBox.Text); ah.ShowDialog(); this.Close(); } } else { if (UserTextBox.Text == "Elbeld" && PassTextBox.Text == "stG65gr5") { MainMenu ah = new MainMenu(); ah.get(UserTextBox.Text); ah.ShowDialog(); this.Close(); } else { MessageBox.Show(" incorrect Username or Password, Please check your entries correctly ", "\t\t Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); UserTextBox.Clear(); PassTextBox.Clear(); UserTextBox.Focus(); conn.Close(); UserReader.Close(); } } conn.Close(); }
private void SubmitButton_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(UserTextBox.Text)) { UserTextBox.Focus(); UserTextBox.BackColor = Color.LightPink; return; } if (string.IsNullOrWhiteSpace(TitleTextBox.Text)) { TitleTextBox.Focus(); TitleTextBox.BackColor = Color.LightPink; return; } if (string.IsNullOrWhiteSpace(DescriptionTextBox.Text)) { DescriptionTextBox.Focus(); DescriptionTextBox.BackColor = Color.LightPink; return; } ReportData rd = new ReportData { Id = ErrorIdTextBox.Text, User = UserTextBox.Text, DateTime = RegistrationDatePicker.Value, Title = TitleTextBox.Text, Description = DescriptionTextBox.Text, Urgent = UrgentCheckBox.Checked, Type = BugRadioButton.Checked ? ReportType.BUG : DocumentationIssueRadioButton.Checked ? ReportType.DOCUMENTATION : PerformanceIssueRadioButton.Checked ? ReportType.PERFORMANCE : ReportType.NOTICE }; Clear(); DescriptionTextBox.Text = System.Text.Json.JsonSerializer.Serialize <ReportData>(rd); }
private bool Validar() { bool paso = true; if (string.IsNullOrWhiteSpace(UserTextBox.Text)) { errorProvider.SetError(UserTextBox, "Este Campo Esta vacio"); UserTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(PassWordTextBox.Text)) { errorProvider.SetError(PassWordTextBox, "Este Campo Esta vacio"); PassWordTextBox.Focus(); paso = false; } if (PassWordTextBox.TextLength < 8) { errorProvider.SetError(PassWordTextBox, "Las contraseñas son mayor o igual a 8 caracteres"); PassWordTextBox.Focus(); paso = false; } return(paso); }
protected void Page_Load(object sender, EventArgs e) { UserTextBox.Focus(); //フォーカスの自働セット this.Form.DefaultButton = LogonButton.UniqueID; //Enterでログオン処理 }
private void button1_Click(object sender, EventArgs e) { UserTextBox.Text = ""; PasswordTextBox.Clear(); UserTextBox.Focus(); }
public Window1() { InitializeComponent(); UserTextBox.Focus(); }