コード例 #1
0
 public ComPortTrue(Ecoview parent)
 {
     InitializeComponent();
     this._Ecoview = parent;
     string[] ports = SerialPort.GetPortNames();
     comboBox1.Items.Clear();
     comboBox1.Items.AddRange(ports);
     if (ports.Length != 0)
     {
         comboBox1.SelectedIndex = 0;
         _Ecoview.nonPort        = true;
     }
     else
     {
         MessageBox.Show("Подсоедините спектрофотометр и попробуйте подключиться снова!");
         _Ecoview.nonPort = false;
         Close();
         // Dispose();
     }
 }