Application #73. Read From and Write To a Text File

This topic describes some of the functionality provided by classes in the System.IO namespace for working with text files. The sample application examines various ways of reading text data and saving changes back to the file.

Note

See “Application #55: Use the File System” in Chapter 7 for information on how to retrieve file-system information about files and directories.

Building Upon...

Application #30: Use Common Dialog Boxes

New Concepts

The System.IO namespace contains many types for working with text files such as the File, StreamReader, and StreamWriter classes.

Using the File Class

The System.IO.File class provides a number of shared methods for working with both binary and text ...

Get 101 Microsoft® Visual Basic® .NET Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.