private void Task_SendMessage() { if (Global_UartCmdPaddingString == "\\n") serialPort1.Write(Global_UartCmdString + "\n"); else if (Global_UartCmdPaddingString == "\\r") serialPort1.Write(Global_UartCmdString + "\r"); else if (Global_UartCmdPaddingString == "\\r\\n") serialPort1.Write(Global_UartCmdString + "\r\n"); else if (Global_UartCmdPaddingString == "0x00") { byte[] _byteSend = new byte[1] { 0x00 }; serialPort1.Write(Global_UartCmdString); serialPort1.Write(_byteSend, 0, 1); } else if (Global_UartCmdPaddingString == "None") serialPort1.Write(Global_UartCmdString); else MessageBox.Show("Error Sending UART in Padding\n" + Global_UartCmdPaddingString); }