Getting Serial Port Information and Sorting the Results in C#
Posted
by Jim Fell
on Stack Overflow
See other posts from Stack Overflow
or by Jim Fell
Published on 2010-05-14T22:16:11Z
Indexed on
2010/05/14
22:44 UTC
Read the original article
Hit count: 739
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 in the list that are after index 0. Does anyone have any suggestions for doing this? Any thoughts you may have would be appreciated. Thanks.
© Stack Overflow or respective owner