PipeStream.ReadByte 方法

定义

从管道读取字节。Reads a byte from a pipe.

public:
 override int ReadByte();
[System.Security.SecurityCritical]
public override int ReadByte ();
override this.ReadByte : unit -> int
Public Overrides Function ReadByte () As Integer

返回

强制转换为 Int32 的字节或 -1 指示到达流的末尾(管道已关闭)。The byte, cast to Int32, or -1 indicates the end of the stream (the pipe has been closed).

属性

异常

管道已关闭。The pipe is closed.

管道不支持读取操作。The pipe does not support read operations.

管道已断开连接,正在等待连接,或尚未设置句柄。The pipe is disconnected, waiting to connect, or the handle has not been set.

发生了 I/O 错误。Any I/O error occurred.

注解

使用 CanRead 属性来确定当前 PipeStream 对象是否支持读操作。Use the CanRead property to determine whether the current PipeStream object supports read operations.

适用于