Beispiel #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     //断开
     try
     {
         udpClient       = null;
         panel2.Enabled  = false;
         button1.Enabled = true;
     }
     catch (Exception ex)
     {
         Communication.BasicFramework.SoftBasic.ShowExceptionMessage(ex);
     }
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                udpClient       = new NetUdpClient(textBox1.Text, int.Parse(textBox2.Text));
                udpClient.Token = new Guid(textBox3.Text);

                panel2.Enabled  = true;
                button1.Enabled = false;
            }
            catch (Exception ex)
            {
                HslCommunication.BasicFramework.SoftBasic.ShowExceptionMessage(ex);
            }
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!System.Net.IPAddress.TryParse(textBox1.Text, out System.Net.IPAddress address))
            {
                MessageBox.Show(DemoUtils.IpAddressInputWrong);
                return;
            }

            //连接
            try
            {
                udpClient = new NetUdpClient(textBox1.Text, int.Parse(textBox2.Text));

                panel2.Enabled  = true;
                button1.Enabled = false;
            }
            catch (Exception ex)
            {
                Communication.BasicFramework.SoftBasic.ShowExceptionMessage(ex);
            }
        }