title: How to write character string to serial port using SerialPort.Write(String)
body: <p>Im trying to write a string to the serial port using SerialPort.Write(String).
  So far i try it like followed</p>
  
  <p>I instantiate the serial port object in my constructor.
  EDIT: Setting the port parameters solved the problem.</p>
  
  <pre><code>public CSerialPort()
  {
      this._serialPort = new SerialPort("COM6",1200,Parity.None,8,StopBits.One);
      this._serialPort.DataReceived += OnSerialPortDataReceived;
  }
  </code></pre>
  
  <p>I open the port:</p>
  
  <pre><code>public void OpenSerialPort()
  {
      try
      {
          _logger.DebugFormat("Trying to open Serial Port: {0}", this._serialPort.PortName);
          this._serialPort.Open();
          this.PortIsOpen = true;
      }
      catch (UnauthorizedAccessException ex)
      {
          _logger.DebugFormat("Trying to open Serial Port: {0}", ex);
      }
      catch (ArgumentOutOfRangeException ex)
      {
          _logger.DebugFormat("Trying to open Serial Port: {0}", ex);
      }
      catch (ArgumentException ex)
      {
          _logger.DebugFormat("Trying to open Serial Port: {0}", ex);
      }
      catch (InvalidOperationException ex)
      {
          _logger.DebugFormat("Trying to open Serial Port: {0}", ex);
      }
  }
  </code></pre>
  
  <p>And i try to send the content of a string via the serial port:</p>
  
  <pre><code>public void WriteToSerialPort(string writeBuffer)
  {
      this._serialPort.Write(writeBuffer);
  }
  </code></pre>
  
  <p>Where the content of the String is:</p>
  
  <pre><code>this._serialPort.WriteToSerialPort("ABC");
  </code></pre>
  
  <p>My problem is that on the receiving side (another PC with a serial port monitoring software) i dont receive the "ABC".
  What i receive is "þ" which is ASCII character code 254.</p>
  
  <p>I tried to change the Encoding property to all available encodings, but that didn't help.</p>
  
  <p>Can anybody tell me what i can do to send any character string to the serial port using the serial port class?
  Did i miss or misunderstand anything?</p>