0

Hi group,

I'm attempting to use a variable (i) to read the multiple files within a folder. However this doesn't seem to be working. Can you tell me what I'm doing wrong?

For i = 0 To counter
Dim objReader As New System.IO.StreamReader(getRestranName(i))

    If System.IO.File.Exists(folderName) Then
         Do While objReader.Peek() <> -1
            txtLine = objReader.ReadLine()
            If lineNo = 3 Then
               programName = Trim(Microsoft.VisualBasic.Left(txtLine, 10))

In advance, thanks for your help.

Don

2
Contributors
3
Replies
16
Views
2 Years
Discussion Span
Last Post by doncwilson_1
0

Shark1, the problem I'm having is that StreamReader isn't reading "getRestranName(i)". My assumption is that the "i" is the problem. But I'm not sure why.

0

Shark1, I found the issue. I changed (folderName) to (getRestranName(i)). That solved it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.