void comPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { try { if (comPort.IsOpen == true)//comPort is serial port which i use in my project { bytes = comPort.BytesToRead; byte[] comBuffer = new byte[bytes]; comPort.Read(comBuffer, 0, bytes); } } catch (Exception ex) { } }
SerialPort.ReadExisting()
Quote:Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the SerialPort object.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)