Murray Brown
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(oT extFilePat hAndName)
With oReader
oReadLine = .ReadLine
.Close()
End With
oReader = Nothing
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
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(oT
With oReader
oReadLine = .ReadLine
.Close()
End With
oReader = Nothing
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad I could help!
ASKER