





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















11_file_processing.ppt
Input Raw Data
Process (Application)
Output Information
Storage Output from one process can
serve as input to another process.
Storage is referred to as secondary storage, and it is permanent storage. Data is permanently stored in files.
Chocolate Almond
Espresso Roast Jamaican Blue Mtn.
Kona Blend Vanilla Nut
private void mnuFileLoad_Click(object sender, EventArgs e) { //Not checking if a list has already been loaded string strFileName; string strFlavorName;
//Open the file and load the list box with the data stored in the file try { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "txt files (.txt)|.txt|All files (.)|." ; openFileDialog1.FilterIndex = 1; // At first only show text files. openFileDialog1.InitialDirectory = Application.StartupPath; //default folder openFileDialog1.RestoreDirectory = true; // restore path to default folder
connects the internal name to the external file.
Operating Systems (OS).
Use Try/Catch When Opening Files
private void mnuFileExit_Click( … ) { //cblnIsDataSaved checked in Form Closing event procedure. this.Close( ); }
private void frmCS11ex_FormClosing( … ) { DialogResult dgrResponse;
if (cblnIsDataSaved = = false) { dgrResponse = MessageBox.Show("Do you wish to save the list?", "Save", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dgrResponse = = DialogResult.Yes) mnuFileSave_Click( mnuFileSave, new EventArgs( )); if (responseDialogResult == DialogResult.Cancel) e.Cancel = true; //cancel close event } }