سؤال

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

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top