0

How can I detect if a device has been plugged in? I only find detecting removable drives in my searches.

The device i'm specifically trying is an omnikey 5x21 smart card reader.

I need to detect the device being plugged in so I can re-initialize the reader, which only happens on form load, and once the device is plugged out it's no longer usable unless you restart the program.

I'm really new to this thing and I only got the reader working based on some sample code, i'm not sure if there's a smart card function that can help me.

crimson589
  • 1,238
  • 1
  • 20
  • 36
  • After plugged out check every minute to see if it is plugged in again with a [Timer](https://msdn.microsoft.com/en-us/library/system.windows.forms.timer(v=vs.110).aspx)? Also [this post](http://stackoverflow.com/questions/6003822/how-to-detect-a-usb-drive-has-been-plugged-in) may be helpful for detecting usb device. Edit: that post was about USB drives, not sure if it can be used for smart card reader – jack3694078 Mar 15 '16 at 01:22
  • @jack3694078 I can't detect if the device is plugged out either. – crimson589 Mar 15 '16 at 02:43

0 Answers0