Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net Read all lines in a text file

Hi
I have written the following ode to read through a text file
I am missing the looping part to get to the end of the code
What additional code do I need to loop through all the lines of the text file?


   Sub oReadFile(ByVal oTextFilePathAndName As String)
        Try
            Dim oReadLine As String
            Dim oReader As System.IO.StreamReader
            oReader = System.IO.File.OpenText(oTextFilePathAndName)
            With oReader

                oReadLine = .ReadLine

                .Close()
            End With
            oReader = Nothing
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much
Glad I could help!