Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Summary

In this chapter, you learned about streams and why they are used in the .NET Framework to access files and other serial devices. You looked at the basic classes in the System.IO namespace, including:

  • File
  • FileInfo
  • FileStream

You saw that the File class exposes many static methods for moving, copying, and deleting files, FileInfo represents a physical file on disk, and has methods to manipulate this file. A FileStream object represents a file that can be written to, or read from, or both. You also explored StreamReader and StreamWriter classes and saw how useful they were for writing to streams. You saw how to read and write to random files using the FileStream class. Building on this knowledge, you used classes in the System.IO.Compression namespace to compress streams as you write them to disk and also saw how to serialize objects to files. Finally, you built an entire application to monitor files and directories using the FileSystemWatcher class.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint