示例#1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            /////付款前临时代码
            //if (DateTime.Now > DateTime.Parse("2019-2-19"))
            //{
            //    this.Close();
            //    Application.Exit();

            //}
            /////
            System.Net.IPAddress ip;
            bool b = System.Net.IPAddress.TryParse(textBox2.Text, out ip);

            if (!b)
            {
                MessageBox.Show("ip格式不正确");
                return;
            }
            int port;

            b = int.TryParse(textBox3.Text, out port);


            tcpServerListener = new tools.net.zTcpServer(ip, port);
            tcpServerListener.connControl.newMessageEvent += newBlemessageEventFun;
            tcpServerListener.connControl.removeTcpEvent  += connectionDisconnectionEventFun;
            tcpServerListener.start();

            tcpConnection = tcpServerListener.connControl;
            setStartOrEnd(1);
        }