Seek Method

FileStream.Seek Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Sets the current position of this stream to the given value.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Overrides Function Seek ( _
	offset As Long, _
	origin As SeekOrigin _
) As Long

Parameters

offset
Type: System.Int64
The point relative to origin from which to begin seeking.
origin
Type: System.IO.SeekOrigin
Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type SeekOrigin.

Return Value

Type: System.Int64
The new position in the stream.

ExceptionCondition
IOException

An I/O error occurs.

NotSupportedException

The stream does not support seeking, such as if the FileStream is constructed from a pipe or console output.

ArgumentException

Attempted seeking before the beginning of the stream.

ObjectDisposedException

Methods were called after the stream was closed.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft