How can I uniquely identify a USB key from C #?

I would like to know when a USB dongle is inserted. Also, if I can distinguish between USB key A and USB key B, then I am in even better shape. Finally, if I can uniquely identify the key using some kind of hardware serial number, MAC address or something else, then I'm in better shape.

Basically, I consider using a USB dongle as a dongle to “unlock” my C # application.

+4
source share
3 answers

All hard drives have a serial number, USB flash drives are no different. Here is an article with an example project that shows how to get an immutable serial number . Basically, you just need to list the system drives and grab the PNPDeviceID property.

+7
source

You need to get the Hardware ID key .

I don’t see how to subscribe to a connected event, but you can always click on the button.

0
source

. , , . - , .

0

All Articles