示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == null && textBox1.Text == "" &&
                textBox2.Text == null && textBox2.Text == "") return;

            string name = textBox1.Text;
            int capacity = Convert.ToInt32(textBox2.Text);
            proxy.createLobby(name, capacity);

            Lobbies lobbies = new Lobbies(proxy);
            lobbies.Show();
            this.Close();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != null && textBox1.Text != "" &&
                textBox2.Text != null && textBox2.Text != "")
            {
                bool res = proxy.login(textBox1.Text, textBox2.Text);

                if (res)
                {
                    Lobbies lobbies = new Lobbies(proxy);
                    lobbies.Show();
                    this.Close();
                }
                else
                {
                    textBox1.BackColor = Color.Red;
                    textBox2.BackColor = Color.Red;
                }
            }
        }