Chapter 20. Files, Streams, and IO

In this chapter, we will look at how C# supports files and IO. These two areas are related because the mechanism that C# uses for reading and writing files is usually accessed through the classes that are used to find files and directories in the first place. All the classes in this directory can be found in the System.IO and System.IO.Compression namespaces. Table 20-1 provides the summary for this chapter.

Table 20-1. Quick Problem/Solution Reference for Chapter 20

Problem

Solution

Listings

Find the files and directories within a given directory.

Use the Directory or DirectoryInfo classes.

20-1 through 20-3, 20-9

Get detailed information about a file or directory.

Use the Directory, FileInfo, or DirectoryInfo classes. ...

Get Introducing Visual C# 2010 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.