private void init() { try { List <string> list = new List <string>(); string[] ports = USB.getPorts(); //SerialPort.GetPortNames();// comboBox_port.Items.Clear(); for (int i = 0; i < ports.Length; i++) { comboBox_port.Items.Add(ports[i]); } if (ports.Length > 0) { comboBox_port.SelectedIndex = ports.Length - 1; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public PMT200() { InitializeComponent(); usb = new USB(); init(); }