read and write text files

my question is I hope not too dumb, but in the old days

we used to do this:

filename = app.path "&\textfile.txt"

open filename for append as #1

write #1, string1, string2

close #1

also we used to do this:

dim textstring as string

open filename for input as # 1

do while not eof(1)

line input #1 , textstring

'do what ever with textstring

loop

close#1

can anyone please tell me how to do this reletively easy process in

vb.net 2005 enterprise editon, cos Iam blown if i can find it anywhere!!

ps i dont need to know how to declare a string variable or initialise it thankx boys and girls

paulanthonysamson@hotmail.com




Answer this question

read and write text files

  • kidwidahair

    Take a look at this article for a nice walk through on reading and writing text files in VB.NET

  • bryanedds

    The documentation should explain everything you need. You can search in the installed offline help, or here's the online equivalent link:

    Visual Basic Language Concepts
    Reading from Files in Visual Basic



  • intrepid

    Thankx for that my.friend.incyberspace

    will be reading all the artical later today, but it looks the business....

    paul



  • read and write text files