SerialPort.BytesToRead SerialPort.BytesToRead SerialPort.BytesToRead SerialPort.BytesToRead Property

定义

获取接收缓冲区中数据的字节数。Gets the number of bytes of data in the receive buffer.

public:
 property int BytesToRead { int get(); };
[System.ComponentModel.Browsable(false)]
public int BytesToRead { get; }
member this.BytesToRead : int
Public ReadOnly Property BytesToRead As Integer

属性值

接收缓冲区中数据的字节数。The number of bytes of data in the receive buffer.

异常

注解

接收缓冲区包括串行驱动程序的接收缓冲区以及SerialPort对象本身中的内部缓冲。The receive buffer includes the serial driver's receive buffer as well as internal buffering in the SerialPort object itself.

由于属性同时表示缓冲区和 Windows 所创建的缓冲区,因此它可以返回比ReadBufferSize属性更大的值,后者仅表示 Windows 创建的缓冲区。 SerialPort BytesToReadBecause the BytesToRead property represents both the SerialPort buffer and the Windows-created buffer, it can return a greater value than the ReadBufferSize property, which represents only the Windows-created buffer.

适用于