Stream.Position Stream.Position Stream.Position Stream.Position Property

定义

当在派生类中重写时,获取或设置当前流中的位置。When overridden in a derived class, gets or sets the position within the current stream.

public:
 abstract property long Position { long get(); void set(long value); };
public abstract long Position { get; set; }
member this.Position : int64 with get, set
Public MustOverride Property Position As Long

属性值

流中的当前位置。The current position within the stream.

异常

出现 I/O 错误。An I/O error occurs.

流不支持查找。The stream does not support seeking.

在流关闭后调用方法。Methods were called after the stream was closed.

注解

流必须支持查找以获取或设置位置。The stream must support seeking to get or set the position. CanSeek使用属性来确定流是否支持查找。Use the CanSeek property to determine whether the stream supports seeking.

支持查找超出流长度的任何位置。Seeking to any location beyond the length of the stream is supported.

Position属性不跟踪流中已使用的、跳过的或两个字节的字节数。The Position property does not keep track of the number of bytes from the stream that have been consumed, skipped, or both.

适用于

另请参阅