Edarn
asked on
How do I enumerate the available USB ports in C#
Hi!
Hi!
Is there any easy way to get hold of the usb ports that are available on my computer?
Currently I have some external tool that when running it I can see in a log that it uses for example EPIUSB2. Can I list the existing ports somehow?
Kind regards
Thomas Hermansson
Hi!
Is there any easy way to get hold of the usb ports that are available on my computer?
Currently I have some external tool that when running it I can see in a log that it uses for example EPIUSB2. Can I list the existing ports somehow?
Kind regards
Thomas Hermansson
ASKER
Hi!
Thanks, but that source seems not to work I´m afraid. :-/
Thanks, but that source seems not to work I´m afraid. :-/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get:
Error: Additional information: Unable to cast object of type USBDevicesList.core.chub to USBDevicesList.Core.CDevic e.
This happens in line 67 of CGenerateReport.
Error: Additional information: Unable to cast object of type USBDevicesList.core.chub to USBDevicesList.Core.CDevic
This happens in line 67 of CGenerateReport.
You might need to review the code and fix it. But a lot of sources point to it, so it should be worth.
ASKER
I couldn´t get the source code to work on my computer. Will investigate later on what needs to be done, but I belive the code will be sufficiant for me to use.
kind regards
Thomas
kind regards
Thomas
"USB ports don't have names. It is a bus, it doesn't matter what connector you use. Just like it doesn't matter where you plug in a card in the bus inside of the machine."
So you can get the attached devices, not the USB ports themselves. Getting a list of connected devices: http://code.google.com/p/usb-devices-list/