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.

適用於

另請參閱