Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

Does anyone know how to detect if a USB card is plugged in. Is there some event you can use?

 

i.e. have a program written in .net that detects (and does something) when a usb device is inserted?

 

Thanks.

Posted
something that detects hardware when inserted is best left to Microsoft. Your talking very low level programing there... lots of Win32Api calls if not and more than likely even lower (straight C++ or Assebmly).
Posted

im sure theres a way to do it.. all the various software (not just microsoft) for usb devices do it.. e.g. camera software - once you plug in the camera to the usb - it launches the software to download the pictures.. it's this type of event that i need..

 

i've no problem with api calls.. or low level programming.. this is why i'm asking.. anyone know how to do it?

 

thanks.

Posted

Hi,

 

 

Thanks! that looks like its the start. Your code fires when i insert a USB device. Next step is to detect what type of device is inserted. At least i have this for a start.

 

If anyone knows how to get the device signature, i would appreciate it.

 

Thanks again

  • 3 weeks later...
Posted

Handling the WM_DEVICEMESSAGE message I can now detect if any device is (dis)connected. But I only want to focus on USB events. I can't find any good info on this on Google.

 

Maybe anyone here has a clue?

Posted

Same problem

 

Hai,

Base on the sample given by Derek Stone, device changed can be detected, but how can i futher to get the device name ? and when my program start , how can i get the pluged-in USB device as the one at sytem tray program

 

 

Thank you

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...