WHAT YOU WILL LEARN IN THIS CHAPTER
Understanding how .NET uses streams to access files
Writing to and reading from a file
Reading and writing compressed files
Serializing and deserializing objects
Monitoring files and directories for changes
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
wrox.com code downloads for this chapter are found on this book's webpage on Wrox.com on the Download Code tab. The code can also be found at
. The code is in the Chapter20 folder and individually named according to the names throughout the chapter.
Files can be a great way to store data between instances of your application, or they can be used to transfer data between applications. User and application configuration settings can be stored to be retrieved the next time your application is run.
This chapter shows you how to use files effectively in your applications, touching on the major classes used to create, read from, and write to files, and the supporting classes used to manipulate the file system from C# code. Although you won't examine all of the classes in detail, this chapter goes into enough depth to give you a good idea of the concepts and fundamentals.
FILE CLASSES FOR INPUT AND OUTPUT
Reading and writing files is an essential way to get data into your C# program (
input) and send data out of your program ( output). Because files are used for input and output, the file classes are contained ...
Beginning C# 7 Programming with Visual Studio 2017 now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from