title: How to read reliably CTS and DSR status of a Serial Port with C#
body: <p>Back in time(15 years ago) i made a small program on Delphi to monitor, record and show a time-diagram the signals from a I2C communication between PC and I2C-sensor. Now i need the same thing and i have big problem to adapt it for C#. In general i connect CTS line from the serial port to SCL line of a I2C, and DSR to SDA. Then i start a thread that read the status of the CTS and DSR(with endless loop) and save them to a file. This is the code: </p>
  
  <pre><code>        void InitCommPort()
          {
              myCOMport = new SerialPort("COM2", 9600);
              myCOMport.Open();
          }
  
          while (!bExit)
          {
              CTS_Signal = myCOMport.CtsHolding;
              DSR_Signal = myCOMport.DsrHolding;
          }
  </code></pre>
  
  <p>The problem is that i can not get the signals[CTS and DSR] fast enough to reconstruct the communication protocol. Actually mostly i can get only one of the signals, and it is just part of the all transfer. I tried also "SerialPinChangedEventHandler", but I'm receiving only '0' as a result. Obviously I'm missing something or just the SerialPort-Class is made in this way. Is it possible to be done with C#? I do not want to install Windows XP for something simple like that. Any help will be appreciated.
  Thank You in advance </p>