Hour 20. Working with Text Files and the Registry


What You'll Learn in This Hour:

  • Using the Registry object to create and delete Registry keys and values

  • Using a StreamWriter object to open, read, and edit text files

  • Modifying your Picture Viewer program to use a text file and the Registry

Text files have been around since the early days of computing, and even today they are a useful method of storing data. For robust applications, a database is the way to go, but for storing simple sets of data, it doesn't get much easier than using a text file.

By the Way

In the first edition of this book, I neglected to cover working with text files thinking that most users were moving to databases. After many emails from readers, I got the point: Text files are still used regularly, and they aren't going anywhere. This chapter teaches you the basics of creating, opening, reading, and editing text files.


Another common method of storing dataparticularly user settings and program configuration options, is the Windows Registry. The Registry is a database-like storage entity in Windows that resembles a tree with nodes. Accessing the Registry is fast, handled through a consistent interface, and is often preferred over the old method of using INI text files. In this chapter, you'll learn how to store data in and get data from the Windows Registry.




Sams Teach Yourself Microsoft Visual C# 2005 in 24 Hours, Complete Starter Kit
Sams Teach Yourself Visual C# 2005 in 24 Hours, Complete Starter Kit
ISBN: 0672327406
EAN: 2147483647
Year: N/A
Pages: 248
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net