Stream.CanSeek 属性

定义

当在派生类中重写时,获取指示当前流是否支持查找功能的值。When overridden in a derived class, gets a value indicating whether the current stream supports seeking.

public:
 abstract property bool CanSeek { bool get(); };
public abstract bool CanSeek { get; }
member this.CanSeek : bool
Public MustOverride ReadOnly Property CanSeek As Boolean

属性值

如果流支持查找,为 true;否则为 falsetrue if the stream supports seeking; otherwise, false.

注解

如果从 Stream 派生的类不支持查找,则调用 LengthSetLengthPositionSeek 引发 NotSupportedExceptionIf a class derived from Stream does not support seeking, calls to Length, SetLength, Position, and Seek throw a NotSupportedException.

如果流已关闭,此属性将返回 falseIf the stream is closed, this property returns false.

适用于

另请参阅