Click here to Skip to main content
16,007,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to use serial port, and have 2 combo boxes as SerialPort PortName(combo box1) and SerialPort BaudRate(combo box2). i want to use SerialPort PortName for available ports and display just them on combo box, not other ports that maybe not available
what shall i do for this?
Posted

1 solution

You can find out what ports are (probably) availble with SerialPort.GetNames[^] - but...this queries the registry, so it may be inaccurate in that it can return ports that aren't there any more.

And there is no "automatic" system fort detecting "available" ports - if a port is in use by another program it will not be "available" but AFAIK the only way to check is to try opening it and catching the exception.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900