MemoryStream.CanWrite 屬性

定義

取得表示目前資料流是否支援寫入的值。Gets a value indicating whether the current stream supports writing.

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

屬性值

如果資料流支援寫入,則為 true;否則,為 falsetrue if the stream supports writing; otherwise, false.

備註

如果衍生自 Stream 的類別不支援寫入,SetLengthWriteWriteByte 的呼叫會擲回 NotSupportedExceptionIf a class derived from Stream does not support writing, a call to SetLength, Write, or WriteByte throws a NotSupportedException.

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

適用於

另請參閱