VB.NET - Detecting the attachment of removable storage?

  • Thread starter Thread starter Max
  • Start date Start date
M

Max

Not sure exactly how to describe this or if it's even possible, so I'll
do my best and would appreciate some suggestions.

I'm currently working on a service that will allow me to automate some
file and folder manipulations. While this question is not concerning the
primary purpose of the program, I think it would be a nice addition.
What I'd like to be able to do is have the service be able to "detect"
whenever the user attaches some mass storage device (flash drive, usb
hard drives, mp3 players that don't need any soft, some media in card
readers like CF or SD, etc.) and be able to identify it, like by a
serial number or something. Would this be possible through some API
maybe? It's only for Win2k, XP, and 2k3, and all of those all do these
operations very easily and quickly, just a little pop-up from sys tray
to let you know that the device has been identified. How could I monitor
those events, find some information about the device that would separate
it from all others, and then get the drive letter that windows gave it?

Might be a rather complex problem, but like I've said, don't know much
about or how to even begin. If you have any ideas, please let me know.
Thanks.
 
Would you by any chance have some VB code examples? I did a little bit
of looking around, but most of what I found was in C++ and still nothing
that gets me any closer.
 
Back
Top