Ejemplo n.º 1
0
 private void button5_Click(object sender, EventArgs e)
 {
     // 启动串口
     if (busTcpServer != null)
     {
         try
         {
             busTcpServer.StartSerialPort(textBox10.Text);
             button5.Enabled = false;
         }
         catch (Exception ex)
         {
             MessageBox.Show("串口服务器启动失败:" + ex.Message);
         }
     }
     else
     {
         MessageBox.Show("请先启动Tcp服务器:");
     }
 }
 private void button5_Click(object sender, EventArgs e)
 {
     // 启动串口
     if (busTcpServer != null)
     {
         try
         {
             busTcpServer.StartSerialPort(textBox10.Text);
             button5.Enabled = false;
         }
         catch (Exception ex)
         {
             MessageBox.Show("Start Failed:" + ex.Message);
         }
     }
     else
     {
         MessageBox.Show("Start tcp server first please!");
     }
 }