MemoryStream.CanRead 屬性

定義

取得值,指出目前資料流是否支援讀取。Gets a value indicating whether the current stream supports reading.

public:
 virtual property bool CanRead { bool get(); };
public override bool CanRead { get; }
member this.CanRead : bool
Public Overrides ReadOnly Property CanRead As Boolean

屬性值

true,如果資料流已開啟。true if the stream is open.

備註

如果衍生自 Stream 的類別不支援讀取,ReadReadByte 方法的呼叫就會擲回 NotSupportedExceptionIf a class derived from Stream does not support reading, calls to the Read and ReadByte methods throw a NotSupportedException.

如果資料流程已關閉,此屬性會傳回 falseIf the stream is closed, this property returns false.

適用於

另請參閱