.NET Framework Class Library
System.IO.Ports Namespace

The System.IO.Ports namespace contains classes for controlling serial ports. The most important class, SerialPort, provides a framework for synchronous and event-driven I/O, access to pin and break states, and access to serial driver properties. It can be used to wrap a Stream objects, allowing the serial port to be accessed by classes that use streams.

The namespace includes enumerations that simplify the control of serial ports, such as Handshake, Parity, SerialPinChange, and StopBits.

Classes
  ClassDescription
Public class SerialDataReceivedEventArgsProvides data for the DataReceived event.
Public class SerialErrorReceivedEventArgsPrepares data for the ErrorReceived event.
Public class SerialPinChangedEventArgsProvides data for the PinChanged event.
Public class SerialPortRepresents a serial port resource.To browse the .NET Framework source code for this type, see the Reference Source.
Delegates
  DelegateDescription
Public delegate SerialDataReceivedEventHandlerRepresents the method that will handle the DataReceived event of a SerialPort object.
Public delegate SerialErrorReceivedEventHandlerRepresents the method that will handle the ErrorReceived event of a SerialPort object.
Public delegate SerialPinChangedEventHandlerRepresents the method that will handle the PinChanged event of a SerialPort object.
Enumerations
  EnumerationDescription
Public enumeration HandshakeSpecifies the control protocol used in establishing a serial port communication for a SerialPort object.
Public enumeration ParitySpecifies the parity bit for a SerialPort object.
Public enumeration SerialDataSpecifies the type of character that was received on the serial port of the SerialPort object.
Public enumeration SerialErrorSpecifies errors that occur on the SerialPort object.
Public enumeration SerialPinChangeSpecifies the type of change that occurred on the SerialPort object.
Public enumeration StopBitsSpecifies the number of stop bits used on the SerialPort object.