コード例 #1
0
 public Menu(MainWindow login_form, MapuaSurveyBot.bot user_bot)
 {
     this.login_form = login_form;
     this.user_bot   = user_bot;
     InitializeComponent();
     this.textBlock_Username.Text = "Welcome, " + user_bot.Get_Username();
     isRead = false;
 }
コード例 #2
0
 public Menu(LoginForm login_form, MapuaSurveyBot.bot user_bot)
 {
     this.login_form = login_form;
     this.user_bot   = user_bot;
     InitializeComponent();
     labelName.Text = "Welcome, " + user_bot.Get_Username();
     isRead         = false;
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        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();
        }