예제 #1
0
 private void StoreDataInFile(ShoalArea anArea)
 {
     try
     {
         fil.WriteLine(anArea.ShoalAreaRecord);
     }
     catch (DirectoryNotFoundException exc)
     {
         lblError.Text = "Invalid directory"
                         + exc.Message;
     }
     catch (InvalidDataException exc)
     {
         lblError.Text = "Invalid format in data stream"
                         + exc.Message;
     }
     catch (System.IO.IOException exc)
     {
         lblError.Text = exc.Message;
     }
 }
예제 #2
0
        private void FrmWaterDepth_Load(object sender, EventArgs e)
        {
            anArea = new ShoalArea();

            try
            {
                fil = new StreamWriter("WaterData.txt");
                //// To append data onto the end of the file,
                //// as opposed to creating a new file,
                //// add true as the 2nd argument
                //fil = new StreamWriter("WaterData.txt", true);
            }
            catch (DirectoryNotFoundException exc)
            {
                lblError.Text = "Invalid directory"
                                + exc.Message;
            }
            catch (System.IO.IOException exc)
            {
                lblError.Text = exc.Message;
            }
        }
예제 #3
0
 private void FrmWaterDepth_Load(object sender, EventArgs e)
 {
     anArea = new ShoalArea();
 }
예제 #4
0
 private void FrmWaterDepth_Load(object sender, EventArgs e)
 {
     anArea = new ShoalArea();
 }
예제 #5
0
        private void FrmWaterDepth_Load(object sender, EventArgs e)
        {
            anArea = new ShoalArea();

            try
            {
                fil = new StreamWriter("WaterData.txt");
                //// To append data onto the end of the file,
                //// as opposed to creating a new file, 
                //// add true as the 2nd argument
                //fil = new StreamWriter("WaterData.txt", true);
            }
            catch (DirectoryNotFoundException exc)
            {
                lblError.Text = "Invalid directory"
                        + exc.Message;
            }
            catch (System.IO.IOException exc)
            {
                lblError.Text = exc.Message;
            }
        }
예제 #6
0
 private void StoreDataInFile(ShoalArea anArea)
 {
     try
     {
         fil.WriteLine(anArea.ShoalAreaRecord);
     }
     catch (DirectoryNotFoundException exc)
     {
         lblError.Text = "Invalid directory"
                 + exc.Message;
     }
     catch (InvalidDataException exc)
     {
         lblError.Text = "Invalid format in data stream"
                 + exc.Message;
     }
     catch (System.IO.IOException exc)
     {
         lblError.Text = exc.Message;
     }
 }