Esempio n. 1
0
 /* Open a file */
 private void OpenButton_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         DialogResult res = MessageBox.Show("Whould you like to clear the current table (without saving!)?", "Warning", MessageBoxButtons.YesNo);
         if (res == DialogResult.Yes)
         {
             Clear_Click(sender, e);
         }
         FileValidator fv = new FileValidator(openFileDialog1.FileName);
         if (fv.IsFileValid())
         {
             UpdateFilePath(openFileDialog1.FileName);
             File.WriteAllText(@"file_path.txt", openFileDialog1.FileName);
             Console.WriteLine("Adding entries to table...");
             AddManyPorts(fv.GetPortList());
         }
     }
 }