The previous section demonstrated how to create a file for use in sequential-access apps. In this section, we discuss how to read (or retrieve) data sequentially from a file.
ReadSequentialAccessFileForm (Fig. 17.11) reads records from the file created by the program in Fig. 17.9, then displays the contents of each record. Much of the code in this example is similar to that of Fig. 17.9, so we discuss only the unique aspects of the app.
1 // Fig. 17.11: ReadSequentialAccessFileForm.cs 2 // Reading a sequential-access file. 3 using System; 4 using System.Windows.Forms; 5 using System.IO; 6 using BankLibrary; 7 8 namespace ReadSequentialAccessFile ...