I'd like to be able to detect when a USB key is inserted. Furthermore, if I can distinguish between USB key A and USB key B then I am in even better shape. Lastly, if I can uniquely identify the key using some sort of hardware serial number, MAC address or whatever, then I'm in the best shape of all.
Basically I am looking at using a USB key as a hardware dongle to "unlock" my C# application.
All hard-drives have a Serial Number, USB flash drives are no different. Here is an article, with a sample project, that shows how to get the non-volatile serial number. Basically you just need to enumerate the system drives and grab the PNPDeviceID property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With