[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I enumerate the available USB ports in C#

Posted on 2011-10-28
6
Medium Priority
?
401 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:Edarn
  • 3
  • 3
6 Comments
 
LVL 20

Expert Comment

by:TheAvenger
ID: 37044749
From another article:

"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/
0
 

Author Comment

by:Edarn
ID: 37045030
Hi!

Thanks, but that source seems not to work I´m afraid. :-/
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 1500 total points
ID: 37045085
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Edarn
ID: 37045121
I get:
Error: Additional information: Unable to cast object of type USBDevicesList.core.chub to USBDevicesList.Core.CDevice.

This happens in line 67 of CGenerateReport.

0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 37045158
You might need to review the code and fix it. But a lot of sources point to it, so it should be worth.
0
 

Author Closing Comment

by:Edarn
ID: 37061537
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
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question