Reputation: 529
I am working on USB devices and can identify a usb device. But I have a theoretical question.Is it shows any usb device like portable cd drive or specifically flash drives? I could nt check all possibilities due to lack of these hardwares :). Is there any method to identify if it is a flash drive or another usb device.
Please don't beat with what you have tried. I googled regarding same but because of my least experience I couldn't find any.
Thanks
Upvotes: 2
Views: 1987
Reputation: 9064
Please use the class USBSerialNumber
USBSerialNumber usb = new USBSerialNumber();
string serial = usb.getSerialNumberFromDriveLetter("f:\");
MessageBox.Show(serial);
Each pendrive has serial number which is unique.
You can use this class for this purpose.
Download it from following link:
http://www.cfdan.com/posts/Retrieving_Non-Volatile_USB_Serial_Number_Using_C_Sharp.cfm
Upvotes: 3