Where the Microsoft.Management.Infrastructure

2020-07-27 23:40发布

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

example from msdn

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

CimInstance myDrive = new CimInstance(className, Namespace);

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?

标签: c# wmi
1条回答
【Aperson】
2楼-- · 2020-07-28 00:37

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

查看更多
登录 后发表回答