Writing to a File

MustangJoe

Member
Joined
Jan 29, 2004
Messages
6
Im new to the VB.NET Framework and language, and am still a little confused as how to write to a text file with just plain text. Ive figured out how to write a stream of bytes, and how to convert a string to an array of bytes, but I want to write to a file in just plain text. Any help would be greatly appreciated.
 
This is basically how I do it:

Writing:
Code:
Dim objFile As System.IO.File
Dim objTW As System.IO.StreamWriter

objTW = objFile.CreateText(strFileName)
objTW.WriteLine("Hello")
objTW.Close()
 
Ok, I got it to output text now, but for whatever reason my SQL data reader isnt working properly. Ive got 6 rows Im trying to insert into the text file, but it only writes one. More problems to figure out tomorrow I guess.
 
Back
Top