Click here to Skip to main content
16,016,562 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need list of COM port available on system using c#.
Any help, reference reagrding

Thanks in advance
:)
Posted

I imagine you'll be reading up on the Serialport class fairly soon, so here's the link to get you started.

http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames(v=VS.90).aspx[^]

Alan.
 
Share this answer
 
Add namespace: using System.IO.Ports;//

string[] ports = System.IO.Ports.SerialPort.GetPortNames();

foreach (string s in ports)
{
comboBox1.Items.Add(s);
}
 
Share this answer
 
Use WMI. I don't know the specifics, but I'm sure if you google "C# WMI detect serial ports", you'll get thousands of hits.
 
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