Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys ,

How can I list available port in C# with its manufacturer like COMPORT3 - Samsung 3G Modem ?


I ve used the methods below . But even if the cable or device hasnt pluged into computer , it nevertheless lists the device..

Do you know any method ? Thanks in advance for your help.


C#
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_POTSModem");


         foreach (ManagementObject mo in mos.Get())
         {
             string t = mo["Caption"].ToString() + "  -  " + mo["AttachedTo"];

             ListControl1.Items.Add(t);
         }
Posted
Comments
Sergey Alexandrovich Kryukov 4-Dec-13 1:42am    
What could it possibly mean, a manufacturer of a port? :-)
—SA

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