System.IO.Ports Namespace

System.IO.Ports 命名空间包含用于控制串行端口的类。 The System.IO.Ports namespace contains classes for controlling serial ports. 最重要的类 SerialPort 为同步和事件驱动 I/O 提供框架,提供对插针和中断状态的访问,以及对串行驱动程序属性的访问。 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. 它可用于包装 Stream 对象,允许使用流的类访问串行端口。 It can be used to wrap Stream objects, allowing the serial port to be accessed by classes that use streams.

SerialDataReceivedEventArgs

DataReceived 事件提供数据。 Provides data for the DataReceived event.

SerialErrorReceivedEventArgs

ErrorReceived 事件准备数据。 Prepares data for the ErrorReceived event.

SerialPinChangedEventArgs

PinChanged 事件提供数据。 Provides data for the PinChanged event.

SerialPort

表示串行端口资源。 Represents a serial port resource.

枚举

Handshake

指定在为 SerialPort 对象建立串行端口通信时使用的控制协议。 Specifies the control protocol used in establishing a serial port communication for a SerialPort object.

Parity

指定 SerialPort 对象的奇偶校验位。 Specifies the parity bit for a SerialPort object.

SerialData

指定在 SerialPort 对象的串行端口上收到的字符的类型。 Specifies the type of character that was received on the serial port of the SerialPort object.

SerialError

指定在 SerialPort 对象上发生的错误。 Specifies errors that occur on the SerialPort object.

SerialPinChange

指定在 SerialPort 对象上发生的更改的类型。 Specifies the type of change that occurred on the SerialPort object.

StopBits

指定在 SerialPort 对象上使用的停止位的数目。 Specifies the number of stop bits used on the SerialPort object.

委托

SerialDataReceivedEventHandler

表示将处理 SerialPort 对象的 DataReceived 事件的方法。 Represents the method that will handle the DataReceived event of a SerialPort object.

SerialErrorReceivedEventHandler

表示将处理 SerialPort 对象的 ErrorReceived 事件的方法。 Represents the method that will handle the ErrorReceived event of a SerialPort object.

SerialPinChangedEventHandler

表示将处理 SerialPort 对象的 PinChanged 事件的方法。 Represents the method that will handle the PinChanged event of a SerialPort object.

注解

该命名空间包含如简化的串行端口,该控件的枚举HandshakeParitySerialPinChange,和StopBitsThe namespace includes enumerations that simplify the control of serial ports, such as Handshake, Parity, SerialPinChange, and StopBits.