By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,285 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,285 IT Pros & Developers. It's quick & easy.

StreamReader Bug Help

P: n/a
I need help with the streamreader. It appears that when I am reading
the file that the streamreader jumps 3 lines before it is picked up by
my variable again. Therefore I am only capturing a third of the
information. Does anyone know why this is or how to help me get past
this spot.

Dim fs As FileStream
Dim mystr As String
Dim file As String
Dim files() As String
files = IO.Directory.GetFiles([path])
For Each file In files
fs = New FileStream(file, FileMode.Open, FileAccess.Read)
Dim tr As New StreamReader(fs)
tr.BaseStream.Seek(0, SeekOrigin.Begin)
If Left(file.ToString, 47) = [full file name and path] Then
While tr.Peek > -1
mystr = tr.ReadLine()
End While
tr = Nothing
End If

Feb 8 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.