Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The .NET Framework exposes a set of classes for working with text files, drives, and directories, through the System.IO namespace. This namespace exposes functionality that allows you to read from, write to, and update content within directories and text files. On occasion, you will want to read from and write to a text file. Text files almost always use a format that’s based on the ASCII standard, which is perhaps the most widely accepted cross-platform file format, having been around since the 1960s. This makes it a very useful way of exchanging information between programs—even if they’re running on different platforms and operating systems.
As we’ll see in the course of this chapter, we can use the set of classes exposed by the System.IO namespace to complete the following tasks: