title: How to send 8 bits binary data to serial port
body: <p>I have to send data in binary format and also have to receive on the other end in binary format.  I have sent data from serial port but don't know how to send binary data to serial port.  Is this right way to write the 8 bits binary data/byte to serial port.Please anybody help. thanks in advance.</p>
  
  <pre><code>port = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One);
  port.DtrEnable = true;
  port.RtsEnable = true;
  port.Handshake = Handshake.RequestToSend;
  port.ReadTimeout = 6000;
  port.WriteTimeout = 5000;
  port.Open();
  byte[] b={0,1,1,0,1,1,1,0,1};
  port.Write(b, 0, 8);
  </code></pre>