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




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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.