How to read text file line by line in VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Using reader As TextReader = File.OpenText("d:\data.txt")
            Dim l As String

            l = reader.ReadLine()
            Do Until l Is Nothing
                Console.WriteLine(l)
                l = reader.ReadLine()
            Loop
        End Using

    End Sub

End Module

' run:
' 
' c cpp python cshap
' java php

 



answered Sep 29, 2018 by avibootz

Related questions

1 answer 266 views
1 answer 205 views
2 answers 270 views
270 views asked Oct 24, 2018 by avibootz
1 answer 305 views
1 answer 291 views
1 answer 226 views
1 answer 221 views
...