S
Shawn
Hi. I'm using this code to loop through all the lines in a text field:
While myStreamReader.Peek() > -1
myStreamReader.ReadLine()
i = i + 1
End While
Now, what I need to do is to loop through all the lines one more time and do
the work that I'm supposed to do. The reason for this is that I have to
know how many lines exists in the text file in order to display a
ProgressBar to the user. I've tried setting
myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin) but
myStreamReader.Peek() just returns -1.
Is it not possible to achieve this without having to close the FileStream
and create a new one?
Thanks,
Shawn
While myStreamReader.Peek() > -1
myStreamReader.ReadLine()
i = i + 1
End While
Now, what I need to do is to loop through all the lines one more time and do
the work that I'm supposed to do. The reason for this is that I have to
know how many lines exists in the text file in order to display a
ProgressBar to the user. I've tried setting
myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin) but
myStreamReader.Peek() just returns -1.
Is it not possible to achieve this without having to close the FileStream
and create a new one?
Thanks,
Shawn