Blog Of Sem: visual basic read two lines from text file

visual basic read two lines from text file

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim fileReader As System.IO.StreamReader
        fileReader =
        My.Computer.FileSystem.OpenTextFileReader("C:\Users\Digikey\Desktop\MyApplication6\testfile.txt")
        Dim stringReader1, stringReader2 As String



        stringReader1 = fileReader.ReadLine()
        stringReader2 = fileReader.ReadLine()
        MsgBox("The first line of the file is " & stringReader1)
        MsgBox("The second line of the file is " & stringReader2)
    End Sub
End Class