OpenOutputFile() static private method

static private OpenOutputFile ( ) : void
return void
Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Program.pollRate = Int32.Parse(textBox1.Text);
         Program.filename = textBox2.Text;
         Program.OpenOutputFile();
         //save to ini file
         using (FileStream fs = new FileStream("AnAppADay.TimeManagement.WinApp.jedi", FileMode.Create, FileAccess.Write))
         {
             using (StreamWriter sw = new StreamWriter(fs))
             {
                 sw.WriteLine(Program.pollRate);
                 sw.WriteLine(Program.filename);
                 sw.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error saving options: " + ex.Message + Environment.NewLine + ex.StackTrace);
     }
     finally
     {
         Close();
     }
 }