How do we find the serial number of a USB drive without using WMI in c#?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following link looks like a good place to start if you can use WMI. Volatile USB Serial Number Using C#.
You could implement a WMI soloution as this looks like it is pretty simple code and has been fairly extensivly tested. If you get a WMI error you could gracefully fall into another implementation using non WMI calls.
To get the serial number without using WMI I would recommend that you look at the microsoft scripting runtime. You can add this to your project references from the COM tab.