Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect USB port in use

Status
Not open for further replies.

gharabed

Programmer
Sep 7, 2001
251
US
I was wondering how (from vb.net) you automatically detect a usb port that is connected and in use? I am really reading from a serial device connected through a usb port and at this point it is a manual thing where I have to look and see which port is allocated (e.g. COM12). I'd like to be able to automatically detect which port it is connected to. How would I do that?
 
To the best of my knowledge the only thing you can do here is iterate the ports on the machine and 'speak' to them until you get the reply you are expecting.

By using this approach it won't matter what port the user inserts their device in, provided of course you can guarantee that the device will give you a uniquely identifiable response, as there could be anything on the port from a Flash Drive to a Printer.


woogoo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top