MustangJoe Posted January 29, 2004 Posted January 29, 2004 I'm 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. I've 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. Quote
Administrators PlausiblyDamp Posted January 29, 2004 Administrators Posted January 29, 2004 If you are writing out just text then you may want to look at the StreamWriter class. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted January 29, 2004 Posted January 29, 2004 This is basically how I do it: Writing: Dim objFile As System.IO.File Dim objTW As System.IO.StreamWriter objTW = objFile.CreateText(strFileName) objTW.WriteLine("Hello") objTW.Close() Quote Thanks Sam http://www.samsmith.co.nz
MustangJoe Posted January 29, 2004 Author Posted January 29, 2004 Ok, I got it to output text now, but for whatever reason my SQL data reader isn't working properly. I've got 6 rows I'm trying to insert into the text file, but it only writes one. More problems to figure out tomorrow I guess. Quote
samsmithnz Posted January 29, 2004 Posted January 29, 2004 can you post some code? Quote Thanks Sam http://www.samsmith.co.nz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.