Seek file position : Stream « Stream File « VB.Net Tutorial






Imports System.IO


Public Class Tester
    Public Shared Sub Main
        Dim f As System.IO.File
        Dim r As System.IO.Stream
        Dim mylength As Integer
        Dim i As Integer
        Dim s As Integer
        Dim mybuffer(100) As Byte
        r = f.OpenRead("test.txt")
        mylength = r.Read(mybuffer, 0, 100)
        For i = 0 To mylength
            r.Seek(i, IO.SeekOrigin.Begin)
            s = r.ReadByte()
            Console.WriteLine(Chr(s))
        Next
        r.Close()

    End Sub

End Class








13.17.Stream
13.17.1.Stream read operation
13.17.2.Stream seek operation
13.17.3.Read from text file
13.17.4.Seek file position