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 284 views
1 answer 215 views
2 answers 287 views
287 views asked Oct 24, 2018 by avibootz
1 answer 325 views
1 answer 305 views
1 answer 235 views
1 answer 231 views
...