为什么我得到类型或命名空间名称“ManagementEventWatcher”在下面的代码没有找到:类型或命名空间名称“ManagementEventWatcher”未找到
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Management;
class Program {
public ManagementEventWatcher mgmtWtch;
static void Main(string[] args)
{
InitializeComponent();
mgmtWtch = new System.Management
.ManagementEventWatcher("Select * From Win32_ProcessStartTrace");
mgmtWtch.EventArrived += new
System.Management.EventArrivedEventHandler(mgmtWtch_EventArrived);
mgmtWtch.Start();
}
}
我觉得我的DLL没有这个方法,但如何检查?
请解释一下这个问题。解释你到底在挣扎着什么。 – BugFinder 2011-06-02 17:57:14
未找到类型或命名空间名称'ManagementEventWatcher' – 2011-06-02 18:00:27
您是否缺少程序集引用?请参阅[如何将system.management.dll引用添加到项目](http://stackoverflow.com/a/22223788/3240038)的分步操作方法。 – 2017-04-11 23:15:09