Sets the position within the current stream.
[Visual Basic] Public Overridable Function Seek( _ ByVal offset As Integer, _ ByVal origin As SeekOrigin _ ) As Long [C#] public virtual long Seek( int offset, SeekOrigin origin ); [C++] public: virtual __int64 Seek( int offset, SeekOrigin origin ); [JScript] public function Seek( offset : int, origin : SeekOrigin ) : long;
- A byte offset relative to origin.
- A field of SeekOrigin indicating the reference point from which the new position is to be obtained.
The position with the current stream.
|IOException||The file pointer was moved to an invalid location.|
|ArgumentException||The SeekOrigin value is invalid.|
The following table lists examples of other typical or related I/O tasks.
|To do this...||See the example in this topic...|
|Create a text file.||Writing Text to a File|
|Write to a text file.||Writing Text to a File|
|Read from a text file.||Reading Text from a File|
|Read from a binary file.||Reading and Writing to a Newly Created Data File|
|Write to a binary file.||Reading and Writing to a Newly Created Data File|
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework