This documentation is archived and is not being maintained.
How to: Write Text to a File
.NET Framework 2.0
The following code examples show how to write text to a text file.
The first example shows how to add text to an existing file. The second example shows how to create a new text file and write a string to it. Similar functionality can be provided by the WriteAllText methods.
Note |
|---|
| Visual Basic users may choose to use the methods and properties provided by the My.Computer.FileSystem object for file I/O. For more information, see My.Computer.FileSystem Object. |
Example
See Also
Show:
Note