Darrell

Darrell

New Member
Joined
Jun 4, 2009
Messages
1
Reaction score
0
I am a newbie VB programer, I have coded a project to write input from a form into a flat txt file but i'm strugling to do the opposite i.e(reading from the txt file back to the form). I can actually do it but it only reads the first record.

any help will be apprieciated
 
This code reads and writes...
Code:
Dim oFile As System.IO.StreamReader
        Dim wFile As System.IO.StreamWriter
        Dim ReadLine As String

        oFile = New System.IO.StreamReader(InFile)
        wFile = New System.IO.StreamWriter(OutFile)
        While oFile.EndOfStream = False
            ReadLine = oFile.ReadLine.Replace(" ", "")
            wFile.WriteLine("Text to write")
        End While
        wFile.Close()
        oFile.Close()
 
Top
Sign up to the MyBroadband newsletter
X