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

StreamReader reads from another file

P: n/a
I have 2 text files. No matter what I do, this code always read lines
from the same file and not from the file specified in txtFile.Text. I
can't get it... any idea why?

Dim oRead As StreamReader
Dim fs As FileStream
Dim cLine As String

fs = New FileStream(txtFile.Text, FileMode.Open)
oRead = New StreamReader(fs)

lblCantReg.Text = k.ToString
cLine = oRead.ReadLine()
'Process cLine
Loop Until cLine Is Nothing

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Sorry, my mistake.
Don't know why, all my text files had the same content.

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.