StreamReader reads from another file

M

martinaguilar

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)

Do
lblCantReg.Text = k.ToString
cLine = oRead.ReadLine()
'Process cLine


Loop Until cLine Is Nothing
oRead.Close()
fs.Close()
 
M

martinaguilar

Sorry, my mistake.
Don't know why, all my text files had the same content.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top