O'Reilly logo

Beginning Visual C# 2012 Programming by Christian Nagel, Daniel Kemper, Morgan Skinner, Jon Reid, Jacob Vibe Hammer, Karli Watson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 21

File System Data

WHAT YOU WILL LEARN IN THIS CHAPTER

  • What a stream is and how .NET uses stream classes to access files
  • How to use the File object to manipulate the file structure
  • How to write to and read from a file
  • How to read and write formatted data from and to files
  • How to read and write compressed files
  • How to serialize and deserialize objects
  • How to monitor files and directories for changes

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter at www.wrox.com/remtitle.cgi?isbn=9781118314418 on the Download Code tab. The code is in the Chapter 21 download and individually named according to the names throughout the chapter.

Reading and writing files are essential aspects of many .NET applications. This chapter shows you how, 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.

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. Delimited text files, such as comma-separated files, are used by many legacy systems, and to interoperate with such systems, you need to know how to work ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required