Sets the position within the current stream.
Namespace: System.IOAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual long Seek(
int offset,
SeekOrigin origin
)
Parameters
- offset
- Type: SystemInt32
A byte offset relative to origin. - origin
- Type: System.IOSeekOrigin
A field of SeekOrigin indicating the reference point from which the new position is to be obtained.
Return Value
Type:
Int64The position with the current stream.
Exceptions Exception | Condition |
---|
IOException | The file pointer was moved to an invalid location. |
ArgumentException | The SeekOrigin value is invalid. |
See Also