为什么不能在VS2010 C#中使用ManagementObjectSearcher

Oca*_*tes 7 c#

我正在尝试使用这篇文章中的代码: 获取USB适配器的com端口号

然后我收到了这条消息:为什么? 在此输入图像描述

Raj*_*ian 36

您必须System.Management通过VS 2010 添加对手动的引用.

  1. 右键单击Project,Add References

  2. 选择组件选项卡并搜索System.Management.然后添加参考.