Writing to File
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
I need to write out a text file to a users "My Documents" folder from a VB.NET Windows Application. Has anyone else done this and could you help me get started? Thank you,
Environment.SpecialFolder will give you the path to the My Documents folder. This is a C# example, but remove the semicolons and it should work in VB.NET. // create a writer and open the file TextWriter tw = new StreamWriter("date.txt"); // write a line of text to the file tw.WriteLine(DateTime.Now); // close the stream tw.Close(); Christian Graus - Microsoft MVP - C++