F
funkmusha
I am trying to read a log file using vb.net. I get an error stating
"The process cannot access the file 'C:\test.log' because it is being
used by another process." Below is a sample of what I am trying to do.
The var logFileName is being passed into the function.
Dim line as String
Dim sr As New StreamReader(logFileName) 'It dies on this line
Do
line = sr.ReadLine()
Loop Until line is Nothing
sr.Close()
I am new to dot net and not sure if there is another class I should be
using other than the StreamReader class. I just want to read the file
line by line nothing more. Any help would be great. Thanks
"The process cannot access the file 'C:\test.log' because it is being
used by another process." Below is a sample of what I am trying to do.
The var logFileName is being passed into the function.
Dim line as String
Dim sr As New StreamReader(logFileName) 'It dies on this line
Do
line = sr.ReadLine()
Loop Until line is Nothing
sr.Close()
I am new to dot net and not sure if there is another class I should be
using other than the StreamReader class. I just want to read the file
line by line nothing more. Any help would be great. Thanks