Detect usb drive and his name

  • Thread starter Thread starter ladal
  • Start date Start date
L

ladal

Hi

I just want to know how do I detect an usb drive when it's plug and
retrieve his name, in vb.net

Thanx
 
Hi,

You'll need WMI for this. It will allow you to enumerate all removable
devices in the system and query their properties such as label, serial
number etc. If you want notification of when a drive is connected, WMI
should be able to handle that as well.

There is an excellent WMI plugin for the server explorer in VS.NET available
free on the MS website, it will assist in wiring up event code for WMI
classes.

Good luck!
Alex Clark
 
Monitor WM_DEVICECHANGE messages and watch for the DBT_DEVICEARRIVAL and
DBT_DEVICEREMOVECOMPLETE messages pertaining to your device. Also look at
RegisterDeviceNotification.

Also, check RegisterDeviceNotification in the Platform SDK: Device I/O.

Probably the best bet is, this book and these websites:

"USB Complete" Jan Axelson, Lakeview Research, http://www.lvr.com ,

and http://www.usb.org/phpbb


Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics
 
Marc Reinig said:
Monitor WM_DEVICECHANGE messages and watch for the DBT_DEVICEARRIVAL and
DBT_DEVICEREMOVECOMPLETE messages pertaining to your device. Also look at
RegisterDeviceNotification.

Also, check RegisterDeviceNotification in the Platform SDK: Device I/O.

Probably the best bet is, this book and these websites:

"USB Complete" Jan Axelson, Lakeview Research, http://www.lvr.com ,

and http://www.usb.org/phpbb


Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics


Hi

Thanx for your replies.
But can u give me some code sample in vb.net ?

Ladal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top