MemoryStream.CanSeek 屬性

定義

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

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

屬性值

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

備註

Stream如果衍生自的類別不支援搜尋, 則Length呼叫、 SetLengthPositionSeek會擲NotSupportedException回。If a class derived from Stream does not support seeking, calls to Length, SetLength, Position, and Seek throw a NotSupportedException.

如果資料流程已關閉, 則這個屬性false會傳回。If the stream is closed, this property returns false.

適用於

另請參閱