Hi
using system.io.ports
string[] ports = SerialPort.GetPortNames();
var sortedList = ports.OrderBy(port => Convert.ToInt32(port.Replace("COM", string.Empty)));
foreach(string port in ports)
{
DrpPort.Items.Add(port);
DrpPort.DataBind();
}
It is not displaying anything in Drop-Down , it is not going in loop.
Thanks
Loading
Sam HobbsPosted Oct 4, 2011, 1:40 PM
Javeed M ShaikhPosted Oct 4, 2011, 3:52 PM
Please do not forget to mark "Accepted Answer".
VulpesPosted Oct 4, 2011, 4:19 AM
I'd print out the value of ports.Length to see whether it's greater than zero.