How do we find the serial number of a USB drive without using WMI in c#?
Thanks
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.
I don't think that C# has any native APIs for that sort of thing, but this blog post suggests a way to do it with interop. Code is in VB.net, but it shouldn't be too hard to translate into c# Hope that helps.