As some of you know I am moving to VB.net from VB5. I see that to read and write to text files there are two options

1) Use System.IO.File e.g Filewritealltext ( options...)

or

2) Use Streamwriter e.g Dim ts as StreamWriter( options...)

Are there any differences, apart from syntax, that I should be aware of, e.g speed, memory use, etc. Both appear to do same thing if reading and ariting to text files.

My preference is that if I am reading/writing enormous files I use StreamReader/Writer but if I am working with smaller files (anything under 1000 lines or so) I read/write the entire file all at once and skip the Streaming.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.