Exemple #1
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (statusLabel.Text == "Connected")
     {
         if (usernameTextBox.Text != "" && passwordTextBox.Text != "")
         {
             Tuple <bool, bool> login = network.login(usernameTextBox.Text, passwordTextBox.Text);
             if (login.Item1)
             {
                 Form form = new FormClient(network, login.Item2, usernameTextBox.Text.ToLower());
                 this.Hide();
                 if (form.ShowDialog() == DialogResult.Cancel)
                 {
                     this.Dispose();
                 }
             }
             else
             {
                 MessageBox.Show("Wrong username or password");
             }
         }
         else
         {
             MessageBox.Show("Please enter a username and a password!");
         }
     }
 }
Exemple #2
0
 // meme chose pour le client, sauf qu'on lit ce qu'il y a dans la text box
 private void btnClient_Click(object sender, EventArgs e)
 {
     FormClient frm = new FormClient(tBIp.Text); // On envoie l'ip choisie par le client.
     frm.Show();
     this.Hide();
     frm.FormClosing += new FormClosingEventHandler(FormClient_FormClosing);
 }
Exemple #3
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            //Sending to server here:

            Form form = new FormClient(network);
            this.Hide();
            if(form.ShowDialog() == DialogResult.Cancel)
                this.Dispose();
        }
Exemple #4
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (statusLabel.Text == "Connected")
     {
         if (usernameTextBox.Text != "" && passwordTextBox.Text != "")
         {
             Tuple<bool, bool> login = network.login(usernameTextBox.Text, passwordTextBox.Text);
             if (login.Item1)
             {
                 Form form = new FormClient(network, login.Item2, usernameTextBox.Text.ToLower());
                 this.Hide();
                 if (form.ShowDialog() == DialogResult.Cancel)
                     this.Dispose();
             }
             else
                 MessageBox.Show("Wrong username or password");
         }
         else
             MessageBox.Show("Please enter a username and a password!");
     }
 }
Exemple #5
0
 public void SetParent(FormClient parent)
 {
     this.parent = parent;
 }
Exemple #6
0
 public void SetParent(FormClient parent)
 {
     this.parent = parent;
 }