UnmanagedMemoryStream.Seek(Int64, SeekOrigin) UnmanagedMemoryStream.Seek(Int64, SeekOrigin) UnmanagedMemoryStream.Seek(Int64, SeekOrigin) UnmanagedMemoryStream.Seek(Int64, SeekOrigin) Method

定義

將目前資料流的目前位置設為指定值。Sets the current position of the current stream to the given value.

public:
 override long Seek(long offset, System::IO::SeekOrigin loc);
public override long Seek (long offset, System.IO.SeekOrigin loc);
override this.Seek : int64 * System.IO.SeekOrigin -> int64
Public Overrides Function Seek (offset As Long, loc As SeekOrigin) As Long

參數

offset
Int64 Int64 Int64 Int64

相對於「原點」的搜尋起點。The point relative to origin to begin seeking from.

loc
SeekOrigin SeekOrigin SeekOrigin SeekOrigin

使用類型 SeekOrigin 的值,指定開頭、結尾或目前位置作為「原點」 的參考點。Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type SeekOrigin.

傳回

資料流中的新位置。The new position in the stream.

例外狀況

嘗試進行資料流開端前的搜尋。An attempt was made to seek before the beginning of the stream.

offset 值大於資料流的最大值。The offset value is larger than the maximum size of the stream.

備註

如需搜尋的詳細資訊, Seek請參閱。For more information about seeking, see Seek.

適用於