Exemplo n.º 1
0
 private void button_login_Click(object sender, RoutedEventArgs e)
 {
     if (textBox_username.Text != "" && passwordBox.Password != "" && comboBox.SelectedIndex != -1)
     {
         accounts ac = new accounts();
         ac.username1 = textBox_username.Text;
         ac.password1 = passwordBox.Password;
         ac.world     = comboBox.SelectedIndex;
         ((MainWindow)Owner).button_fill.IsEnabled = false;
         ((MainWindow)Owner).tabOLD.Header         = ac.username1;
         this.Close();
         ((MainWindow)Owner).logginin();
         ((MainWindow)Owner).loadbrowser();
     }
     else
     {
         label_error.Content = "Bitte Felder ausfüllen";
         if (textBox_username.Text == "")
         {
             label_username.Foreground = new SolidColorBrush(Colors.Red);
         }
         if (passwordBox.Password == "")
         {
             label_password.Foreground = new SolidColorBrush(Colors.Red);
         }
         if (comboBox.SelectedIndex == -1)
         {
             label_world.Foreground = new SolidColorBrush(Colors.Red);
         }
     }
 }
Exemplo n.º 2
0
 private void button_login_Click(object sender, RoutedEventArgs e)
 {
     if (textBox_username.Text != "" && passwordBox.Password != "" && comboBox.SelectedIndex != -1)
     {
         accounts ac = new accounts();
         ac.username1 = textBox_username.Text;
         ac.password1 = passwordBox.Password;
         ac.world = comboBox.SelectedIndex;
         ((MainWindow)Owner).button_fill.IsEnabled = false;
         ((MainWindow)Owner).tabOLD.Header = ac.username1;
         this.Close();
         ((MainWindow)Owner).logginin();
         ((MainWindow)Owner).loadbrowser();
     }
     else
     {
         label_error.Content = "Bitte Felder ausfüllen";
         if(textBox_username.Text=="")
         {
             label_username.Foreground = new SolidColorBrush(Colors.Red);
         }
         if (passwordBox.Password == "")
         {
             label_password.Foreground = new SolidColorBrush(Colors.Red);
         }
         if (comboBox.SelectedIndex == -1)
         {
             label_world.Foreground = new SolidColorBrush(Colors.Red);
         }
     }
 }
Exemplo n.º 3
0
 public void logginin()
 {
     accounts ac = new accounts();
     String   user = ac.username1, password = ac.password1;
     //btn-login muss gedrückt werden, weltauswahl = logServer, loginName = Benutzername,
     //loginPassword = passworteingabe. Dann mit loginBtn einloggen.
 }
Exemplo n.º 4
0
        /// <summary>
        /// Logindaten werden dem Browser übergeben
        /// </summary>
        public void logger()
        {
            accounts ac = new accounts();
            String   user = ac.username1, password = ac.password1;

            mshtml.HTMLDocument doc = (mshtml.HTMLDocument)browser.Document;
            try
            {
                ((mshtml.HTMLAnchorElement)doc.all.item("btn-login")).click();
                ((mshtml.HTMLTextAreaElement)doc.all.item("loginName")).innerText     = user;
                ((mshtml.HTMLTextAreaElement)doc.all.item("loginPassword")).innerText = password;
                ((mshtml.HTMLSelectElement)doc.all.item("logServer")).selectedIndex   = ac.world;
                ((mshtml.HTMLButtonElement)doc.all.item("loginBtn")).click();
            }
            catch (Exception ef)
            {
                MessageBox.Show("" + ef);
            }
        }