Пример #1
0
 private void COMSend()
 {
     try
     {
         if (checkBoxHEX.Checked)
         {
             comPort.WriteData(SerialPortUtil.HexToByte(txtSend.Text));
         }
         else
         {
             comPort.WriteData(txtSend.Text);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("发送错误:" + ex.Message);
     }
 }
Пример #2
0
 private void COMSend()
 {
     try
     {
         if (checkBoxHEX.Checked)
         {
             comPort.WriteData("");
         }
         else
         {
             comPort.WriteData("");
         }
     }
     catch (System.Exception ex)
     {
         //MessageBox.Show("发送错误:" + ex.Message);
     }
 }