예제 #1
0
        private static void SetPort()
        {
            var ports = ComManager.ListComPorts();

            if (ports.Count(x => x.EqualUsbVid) > 0)
            {
                ComManager.SetComPort(ports.First(x => x.EqualUsbVid).Name);
            }
        }
예제 #2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (comboPorts.SelectedIndex > -1)
            {
                ComManager.SetComPort(comboPorts.SelectedItem
                                      .ToString());
            }

            Close();
        }