private void buttonStart_Click(object sender, EventArgs e) { buttonStart.Text = "Logging in... Please wait!"; buttonStart.Enabled = false; bot = new MapuaSurveyBot.bot(textBoxMyMail.Text, textBoxPassword.Text, !checkBoxHeadless.Checked); if (bot.Login()) { buttonStart.Text = "Logged in!"; Menu menu = new Menu(this, bot); menu.Show(); this.Hide(); } else { MessageBox.Show("Incorrect login. Please try again."); bot.Close(); buttonStart.Text = "LOG IN"; buttonStart.Enabled = true; } textBoxMyMail.Clear(); textBoxPassword.Clear(); }
private void Login() { button_Login.Content = "Logging in... Please wait!"; button_Login.IsEnabled = false; bot = new MapuaSurveyBot.bot(textbox_Mail.Text, passswordBox_Password.Password, !(bool)checkBox_ShowBrowser.IsChecked); if (bot.Login()) { button_Login.Content = "Logged in!"; Menu menu = new Menu(this, bot); menu.Show(); this.Hide(); } else { MessageBox.Show("Incorrect login. Please try again."); bot.Close(); button_Login.Content = "LOG IN"; button_Login.IsEnabled = true; } textbox_Mail.Clear(); passswordBox_Password.Clear(); }