PipeStream.ReadMode 属性


获取或设置 PipeStream 对象的读取模式。Gets or sets the reading mode for a PipeStream object.

 virtual property System::IO::Pipes::PipeTransmissionMode ReadMode { System::IO::Pipes::PipeTransmissionMode get(); void set(System::IO::Pipes::PipeTransmissionMode value); };
[get: System.Security.SecurityCritical]
[set: System.Security.SecurityCritical]
public virtual System.IO.Pipes.PipeTransmissionMode ReadMode { get; set; }
member this.ReadMode : System.IO.Pipes.PipeTransmissionMode with get, set
Public Overridable Property ReadMode As PipeTransmissionMode


PipeTransmissionMode 值之一,指示如何从管道读取 PipeStream 对象。One of the PipeTransmissionMode values that indicates how the PipeStream object reads from the pipe.



所提供的值不是有效的 PipeTransmissionMode 值。The supplied value is not a valid PipeTransmissionMode value.

所提供的值不是此管道流支持的 PipeTransmissionMode 值。The supplied value is not a supported PipeTransmissionMode value for this pipe stream.

尚未设置句柄。The handle has not been set.

- 或 --or-

此管道正在等待与命名的客户端进行连接。The pipe is waiting to connect with a named client.

管道已中断,或命名的客户端发生了 I/O 错误。The pipe is broken or an I/O error occurred with a named client.


匿名管道不支持 Message 模式消息传输。Anonymous pipes do not support Message mode message transmission.

若要避免 InvalidOperationException 访问 ReadMode,可以使用 IsConnected 来验证管道是否已连接。To avoid an InvalidOperationException accessing ReadMode, IsConnected can be used to verify the pipe is connected.