Hour 14. Using Files and Streams

What You’ll Learn in This Hour

Files and directories

Reading and writing data

In Hour 10, “Working with Arrays and Collections,” and Hour 13, “Understanding Query Expressions,” you learned how applications could work with data stored in collections and how to query and manipulate that data. Although these are common activities, many applications need to store or retrieve data from files on a disk.

The .NET Framework treats files as a stream of data. A stream is a sequential flow of packets of data, represented as bytes. Data streams have an underlying storage medium, typically called a backing store, which provides a source for the stream. Fortunately, the .NET Framework makes working with files and directories ...

Get Sams Teach Yourself C# 5.0 in 24 Hours 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.