Beispiel #1
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            ComSelect cs = new ComSelect();

            if (cs.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (cs.comport.StartsWith("file:"))
                {
                    String aFile = cs.comport;
                    aFile = aFile.Remove(0, 5); // remove file:
                    if (File.Exists(aFile))
                    {
                        ReplayFile(aFile);
                    }
                    else
                    {
                        MessageBox.Show("Unable to open " + aFile + " ...");
                        Close();
                    }
                }
                else
                {
                    OpenComPort(cs.comport);
                }
            }
            else
            {
                Close();
            }
        }
Beispiel #2
0
 private void Form1_Shown(object sender, EventArgs e)
 {
     ComSelect cs = new ComSelect();
     if (cs.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if (cs.comport.StartsWith("file:"))
         {
             String aFile = cs.comport;
             aFile = aFile.Remove(0, 5); // remove file:
             if (File.Exists(aFile))
             {
                 ReplayFile(aFile);
             }
             else
             {
                 MessageBox.Show("Unable to open "+aFile+" ...");
                 Close();
             }
         }
         else
         {
             OpenComPort(cs.comport);
         }
     }
     else
     {
         Close();
     }
 }