read & write to Tekstfile

feurich

Well-known member
Joined
Oct 21, 2003
Messages
168
Location
Holland
Hi there,

I am writing an application in VB6 and encountered a problem that (to my knowledge ) isnt solvable or is atleast very difficult in VB6 and my question is. Can it be done in VB.NET?

The problem is I am reading lines from a textfile and processing the information in that line (indexValues and Imagefiles). Now I want to flag the line that is processed by putting an "*" as the first character of that line. I want this because the application is an automated process and when a serious error is encountered (i am logging al the little error) the user should be able to rerun the program again without doing anything, so the application will skip the lines that have an "*" as there first character.

In vb6 you have to open the file as random and read the line from it, but you need the length of the line to be able to get it into an string var.

Can anyone tell me if this is possible in VB.NET or maybe VB6??
 
Sure, and I think this is possible in VB6 too. Open a streamreader to the file, and read the file line by line. Then you can add a * to the beginning of a line if needed, and streamwrite it back to the file line by line.
 
Totally off topic (dotnet), butttttt as i happen to know:

Set a reference to Microsoft Scripting runtime. Use the filesystemobject, and theres a textstream object there somewhere.

If you have anymore vb6 questions, I sugguest you use the http://www.visualbasicforum.com/ forum, the VB6 version of this forum.
 
Found it

Found it, its called :

Code:
Set oFs = CreateObject("Scripting.FileSystemObject")
    oFs.GetStandardStream.ReadLine

Now only to figure out how to use it :-)

Thanks..

Feurich
 
Back
Top