Microsoft.Management.Infrastructure 所在的位置 [英] Where the Microsoft.Management.Infrastructure

查看:41
本文介绍了Microsoft.Management.Infrastructure 所在的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取硬盘信息,我想使用 WMI.

I need to get hdd info, and I want to use WMI.

来自 msdn 的示例

example from msdn

using Microsoft.Management.Infrastructure;
...
string Namespace = @"root\cimv2";
string className = "Win32_LogicalDisk";

CimInstance myDrive = new CimInstance(className, Namespace);

我正在使用 Visual Studio 2015.我在用于测试 WMI 的解决方案中创建了一个 控制台应用程序.没有Microsoft.Management.Infrastructure,如何添加?

I'm using Visual Studio 2015. I've created a console application in solution for testing WMI. There is no Microsoft.Management.Infrastructure, how to add it?

推荐答案

您是否添加了对 Microsoft.Management.Infrastructure.dll 的引用?(如MSDN 页面.)

Have you added a reference to Microsoft.Management.Infrastructure.dll? (As specified at the top of the MSDN page.)

这篇关于Microsoft.Management.Infrastructure 所在的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆