FileStream.CanSeek Property gets a value indicating whether the current stream supports seeking.
Imports System
Imports System.IO
Public Class Test
Public Shared Sub Main()
Dim path As String = "c:\temp\MyTest.txt"
If File.Exists(path) Then
File.Delete(path)
End If
Dim fs As FileStream = File.Create(path)
If fs.CanSeek Then
Console.WriteLine("The stream connected to {0} is seekable.", path)
Else
Console.WriteLine("The stream connected to {0} is not seekable.", path)
End If
fs.Close()
End Sub
End Class
Related examples in the same category