Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Stream.CanSeek Property

When overridden in a derived class, gets a value indicating whether the current stream supports seeking.

[Visual Basic]
Public MustOverride ReadOnly Property CanSeek As Boolean
[C#]
public abstract bool CanSeek {get;}
[C++]
public: __property virtual bool get_CanSeek() = 0;
[JScript]
public abstract function get CanSeek() : Boolean;

Property Value

true if the stream supports seeking; otherwise, false.

Remarks

For an example of creating a file and writing text to a file, see Writing Text to a File. For an example of reading text from a file, see Reading Text from a File. For an example of reading from and writing to a binary file, see Reading and Writing to a Newly Created Data File.

If a class derived from Stream does not support seeking, calls to Length, SetLength, Position, and Seek throw a NotSupportedException.

If the stream is closed, this property returns false.

Requirements

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, Common Language Infrastructure (CLI) Standard

See Also

Stream Class | Stream Members | System.IO Namespace | Working with I/O | Reading Text from a File | Writing Text to a File

Show:
© 2014 Microsoft