C# read only Serial port when data comes
问题 I want read my serial port but only when data comes(I want not polling). This is how I do it. Schnittstelle = new SerialPort("COM3"); Schnittstelle.BaudRate = 115200; Schnittstelle.DataBits = 8; Schnittstelle.StopBits = StopBits.Two; .... And then I start a thread beginn = new Thread(readCom); beginn.Start(); and in my readCom I'm reading continuous (polling :( ) private void readCom() { try { while (Schnittstelle.IsOpen) { Dispatcher.BeginInvoke(new Action(() => { ComWindow.txtbCom.Text =