Sets the position within the current stream.
[Visual Basic] MustOverride Public Function Seek( _ ByVal offset As Long, _ ByVal origin As SeekOrigin _ ) As Long [C#] public abstract long Seek( long offset, SeekOrigin origin ); [C++] public: virtual __int64 Seek( __int64 offset, SeekOrigin origin ) = 0; [JScript] public abstract function Seek( offset : long, origin : SeekOrigin ) : long;
The new position within the current stream.
Exception Type | Condition |
---|---|
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support seeking. |
Stream subclasses that support seeking should override this method to provide the functionality described above. The default implementation simply throws a NotSupportedException.The position cannot be set more than one byte beyond the end of the stream. You can set the position to just beyond the last byte so you can append to the file. Opening a new file and then writing to it requires this.