Changes the position within the current stream by the given offset, which is relative to the stated origin.
- offset
- A long containing the position relative to origin from which to begin seeking.
- origin
- A System.IO.SeekOrigin value specifying the beginning, the end, or the current position as a reference point for offset.
A long containing the new position in the stream.
Type Reason System.IO.IOException An I/O error occurred. NotSupportedException The stream does not support seeking. ArgumentException Attempted seeking before the beginning of the stream or to more than one byte past the end of the stream. ObjectDisposedException The current stream is closed.
Note: Use the FileStream.CanSeek property to determine whether the current instance supports seeking. For additional information, see Stream.CanSeek .Usage
The position can be set beyond the end of the stream.Note: This method overrides Stream.Seek(long, SeekOrigin).
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0