Getting Serial Port Information and Sorting the Results in C#
- by Jim Fell
I have some code that loads the serial ports into a combo-box:
comboBoxComPort.Items.Add("Select COM port...");
foreach (string s in SerialPort.GetPortNames())
{
comboBoxComPort.Items.Add(s);
}
comboBoxComPort.SelectedIndex = 0;
Ideally, I would like to add the port descriptions to the list and sort the items…