问题描述
我们如何找到一个USB驱动器的序列号没有在C#中使用WMI?
How do we find the serial number of a USB drive without using WMI in c#?
感谢
推荐答案
下面这个链接看起来像一个良好的开端,如果你可以使用WMI。
The following link looks like a good place to start if you can use WMI. Volatile USB Serial Number Using C#.
您可以实现一个WMI soloution,因为这看起来是非常简单的代码,并已相当extensivly测试。如果你得到一个WMI的错误,你可以优雅地落入使用非WMI调用另一个实现。
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.
要获得序列号,而无需使用WMI我建议你看一下微软脚本运行时。你可以将它添加到从COM选项卡项目的引用。
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.
这篇关于找到USB驱动器的序列号不WMI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!