private void pictureBox1_Click(object sender, EventArgs e)
 {
     ClientGobang.ChessClass.Client cc = ClientGobang.Program.PublicClientObject;
     cc.CloseConnection();
     if (Out == true)
     {
         listener.Close();
     }
     ConnHandle = 0;
     if (GIP.Trim().Length > 4)
     {
         temMsg2.msgCommand = MsgCommand.ExitJoin;
         udpSocket1.Send(IPAddress.Parse(GIP), 11001, new ClassSerializers().SerializeBinary(temMsg2).ToArray());
         MessageBox.Show("是否关闭窗体");
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            this.pictureBox2.Image   = null;
            this.pictureBox2.Image   = Image.FromFile(ClientClass.ImaDir + "\\Image\\开始按钮灰.png");
            this.pictureBox2.Enabled = false;

            switch (ConnHandle)
            {
            case 1:
            {
                ClientGobang.ChessClass.Client cc = ClientGobang.Program.PublicClientObject;
                if (cc.Connected)
                {
                    cc.CloseConnection();
                }

                try
                {
                    if (GIP == "")
                    {
                        break;
                    }
                    cc.ConnectServer(GIP, int.Parse("11003"));
                }
                catch
                {
                    MessageBox.Show("连接服务器失败");
                    this.pictureBox2.Image   = null;
                    this.pictureBox2.Enabled = true;
                    this.pictureBox2.Image   = Image.FromFile(ClientClass.ImaDir + "\\Image\\开始按钮.png");
                    return;
                }
                WhoFisrtDown = false;
                cc.SendMessage("FiDn" + "Me");
                CanDown    = true;
                ConnHandle = 2;
                break;
            }

            case 2:
            {
                CanAgin      = true;
                WhoFisrtDown = false;
                dropchild    = true;
                CanDown      = true;
                Conqueror    = false;
                ClientGobang.ChessClass.Client cc = ClientGobang.Program.PublicClientObject;
                cc.SendMessage("FiDn" + "Me");
                if (Agin_if == false)
                {
                    cc.SendMessage("Agin#" + "OK?");
                    Agin();
                }
                else
                {
                    Agin_if = false;
                    if (panel_Check.Controls.Count > 10)
                    {
                        Agin();
                    }
                }
                BBow = BBow + 1;
                pBox_Sign.Visible = false;
                Conqueror         = false;
                break;
            }
            }
            childSgin = true;
        }