Section 18.1. Introduction


18.1. Introduction

Variables and arrays offer only temporary storage of datathe data is lost when a local variable "goes out of scope" or when the program terminates. By contrast, files (and databases, which we cover in Chapter 20, Database, SQL and ADO.NET) are used for long-term retention of large amounts of data, even after the program that created the data terminates. Data maintained in files is often called persistent data. Computers store files on secondary storage devices, such as magnetic disks, optical disks and magnetic tapes. In this chapter, we explain how to create, update and process data files.

We begin with an overview of the data hierarchy from bits to files. Next, we overview some of the FCL's file-processing classes. We then present two examples that show how you can determine information about the files and directories on your computer. The remainder of the chapter shows how to write to and read from text files that are human readable and binary files that store entire objects in binary format.



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

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