spyrit Posted November 26, 2003 Posted November 26, 2003 Hi I am using Dim writer As New IO.StreamWriter("C:/FormatLineOutput.txt") writer.Write(TextBox2.Text) writer.Flush() writer.Close() To write the output to a file. But I need to add to the file if it is executed a second time. How can i add moe to this file. Please Help! Quote
Administrators PlausiblyDamp Posted November 26, 2003 Administrators Posted November 26, 2003 open the file with Dim writer As New IO.StreamWriter("C:/FormatLineOutput.txt", True) the second parameter will append to the file if it already exists or create a new file if it doesn't exist. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
spyrit Posted November 26, 2003 Author Posted November 26, 2003 Hi I need it to write to the file on a new line. How can i make it do that? Please reply Quote
Administrators PlausiblyDamp Posted November 26, 2003 Administrators Posted November 26, 2003 writer.WriteLine() will cause it to move to the next line. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
spyrit Posted November 26, 2003 Author Posted November 26, 2003 How can I say If a file is in a location then writeline("blahblah") Else blablahblah End if I'm not sure how to say if a file is in a location Please Help Quote
Leaders dynamic_sysop Posted November 26, 2003 Leaders Posted November 26, 2003 If IO.File.Exists(" file path here") '/// do stuff because it exists. Else '/// it dont exist , do something else. End If Quote
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.