Port Enumeration

  • Thread starter Thread starter Loui Mercieca
  • Start date Start date
L

Loui Mercieca

Hi,

I have an application which uses Serial,Parallel and USB communication. It
also has a configuration page, however i need to enumerate the available
ports ( for all serial, usb and parallel ports). Through a quick search i
found multiple registry keys which are said to give this information however
i would like to be sure that the one i will acessing will infact be the
right one. I am using currently Windows Xp SP2, but would like to achieve
this option over several OSs. Any help woul be apreciated.

Thanks,
 
From memory there is no managed way to do this, you will need to Access an
API.

The other way is to start lookiing at WMI and the system management classes,
from here you can get a lot of information on the systems. WMI is avalible
on Most windows OS.
 
I did manage to do it using wmi. However the only way i found was to use
"Win32_PnPEntity" and search for particular key words.

I did manage to get individual using the Win32_ParallelPort and the
Win32_SerialPort however did not manage to find the same for the USB
devices.. Is this the way to do it or i am missing something??
 
Back
Top