title: How to write a C# program to send hex bytes command to a serial port
body: <p>A small car with wifi is connected to my computer. I wanna send a data package in hex (e.g. <code>FF 00 01 00 FF</code>) to it (IP: 192.168.1.1, Port:2001) with Visual Studio 2015.</p>
  
  <p>I'm a Newbie in C# only with some basic knowledge of C..I just got some API form the car designer and write something as below. But I'm not sure if they are ok to run...</p>
  
  <pre><code>serialPort1.PortName = "COM1"; 
  serialPort1.BaudRate = 9600; 
  serialPort1.Open(); 
  byte [] data= CreateData(0x01, 0x02, 0x03);    //design a hex package 
  comm=this.SerialPort1;                     //I don't know what the "this" mean ?
  RobotEngine2.SendCMD(0, byteData, comm);    //this sentence got from the API 
  </code></pre>
  
  <p>(I'm sorry that the code must be ugly for me such a newbie. But I would really appreciate it if you can help give me some directions. Thank you.)</p>