System.Management 命名空间

提供对一组丰富的管理信息和管理事件(它们是关于符合 Windows Management Instrumentation (WMI) 基础结构的系统、设备和应用程序的)的访问。 Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure. 应用程序和服务可以使用从 ManagementObjectSearcherManagementQuery 派生的类,查询感兴趣的管理信息(例如在磁盘上还剩多少可用空间、当前 CPU 利用率是多少、某一应用程序正连接到哪一数据库等等);或者应用程序和服务可以使用 ManagementEventWatcher 类预订各种管理事件。 Applications and services can query for interesting management information (such as how much free space is left on the disk, what is the current CPU utilization, which database a certain application is connected to, and much more), using classes derived from ManagementObjectSearcher and ManagementQuery, or subscribe to a variety of management events using the ManagementEventWatcher class. 这些可访问的数据可以来自分布式环境中托管的和非托管的组件。 The accessible data can be from both managed and unmanaged components in the distributed environment.

CompletedEventArgs

保存 Completed 事件的事件数据。Holds event data for the Completed event.

ConnectionOptions

指定生成 WMI 连接所需的所有设置。Specifies all settings required to make a WMI connection.

DeleteOptions

指定用于删除管理对象的选项。Specifies options for deleting a management object.

EnumerationOptions

为查询和枚举相关的选项对象提供基类。Provides a base class for query and enumeration-related options objects.

EventArrivedEventArgs

保存 EventArrived 事件的事件数据。Holds event data for the EventArrived event.

EventQuery

表示一个 WMI 事件查询。Represents a WMI event query.

EventWatcherOptions

指定用于管理事件监视的选项。Specifies options for management event watching.

InvokeMethodOptions

指定用于调用管理方法的选项。Specifies options for invoking a management method.

ManagementBaseObject

包含管理对象的基本元素。Contains the basic elements of a management object. 它用作更具体的管理对象类的基类。It serves as a base class to more specific management object classes.

ManagementClass

表示公共信息模型 (CIM) 管理类。Represents a Common Information Model (CIM) management class. 管理类是一个 WMI 类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。A management class is a WMI class such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 通过该类的成员,可以使用特定的 WMI 类路径访问 WMI 数据。The members of this class enable you to access WMI data using a specific WMI class path. 有关详细信息,请参阅 https://msdn.microsoft.com/library 上 MSDN Library 中 Windows Management Instrumentation 文档内的“Win32 类”。For more information, see "Win32 Classes" in the Windows Management Instrumentation documentation in the MSDN Library at https://msdn.microsoft.com/library.

ManagementDateTimeConverter

提供将 DMTF 日期时间和时间间隔转换为符合 CLR 的 DateTimeTimeSpan 格式(或执行相反转换)的方法。Provides methods to convert DMTF datetime and time intervals to CLR-compliant DateTime and TimeSpan format and vice versa.

ManagementEventArgs

表示保存 WMI 事件的事件数据的虚拟基类。Represents the virtual base class to hold event data for WMI events.

ManagementEventWatcher

根据指定的事件查询订阅临时事件通知。Subscribes to temporary event notifications based on a specified event query.

ManagementException

表示管理异常。Represents management exceptions.

ManagementNamedValueCollection

表示适合用作 WMI 操作上下文信息的命名值的集合。Represents a collection of named values suitable for use as context information to WMI operations. 名称不区分大小写。The names are case-insensitive.

ManagementObject

表示 WMI 实例。Represents a WMI instance.

ManagementObjectCollection

表示通过 WMI 检索到的管理对象的不同集合。Represents different collections of management objects retrieved through WMI. 此集合中的对象为从 ManagementBaseObject 派生的类型,包括 ManagementObjectManagementClassThe objects in this collection are of ManagementBaseObject-derived types, including ManagementObject and ManagementClass. 通过 ManagementObjectSearcher 对象执行 WMI 查询,或者通过表示指定类型的 ManagementClass 检索该类型管理对象的枚举,可得到此集合。The collection can be the result of a WMI query executed through a ManagementObjectSearcher, or an enumeration of management objects of a specified type retrieved through a ManagementClass representing that type. 此外,这也可能是以指定方式与特定管理对象相关的管理对象集合 — 在这种情况下,此集合可以通过诸如 GetRelated() 之类的方法检索到。In addition, this can be a collection of management objects related in a specified way to a specific management object - in this case the collection would be retrieved through a method such as GetRelated(). 此集合可以通过 ManagementObjectCollection.ManagementObjectEnumerator 遍历,并且能够针对各种管理任务对集合中的对象进行检查或操作。The collection can be walked using the ManagementObjectCollection.ManagementObjectEnumerator and objects in it can be inspected or manipulated for various management tasks.

ManagementObjectCollection.ManagementObjectEnumerator

表示集合的枚举数。Represents the enumerator on the collection.

ManagementObjectSearcher

基于指定的查询检索管理对象的集合。Retrieves a collection of management objects based on a specified query. 此类是用于检索管理信息的较为常用的入口点之一。This class is one of the more commonly used entry points to retrieving management information. 例如,它可以用于枚举系统中的所有磁盘驱动器、网络适配器、进程及更多管理对象,或者用于查询所有处于活动状态的网络连接以及暂停的服务等。For example, it can be used to enumerate all disk drives, network adapters, processes and many more management objects on a system, or to query for all network connections that are up, services that are paused, and so on. 在实例化之后,此类的实例可以接受在 ObjectQuery 或其派生类中表示的 WMI 查询作为输入,并且还可以选择接受一个 ManagementScope(表示执行查询时所在的 WMI 命名空间)。When instantiated, an instance of this class takes as input a WMI query represented in an ObjectQuery or its derivatives, and optionally a ManagementScope representing the WMI namespace to execute the query in. 它还可以接受 EnumerationOptions 中的其他高级选项。It can also take additional advanced options in an EnumerationOptions. 当调用此对象的 Get() 方法时,ManagementObjectSearcher 在指定的范围内执行给定的查询,并返回与 ManagementObjectCollection 中的查询匹配的管理对象的集合。When the Get() method on this object is invoked, the ManagementObjectSearcher executes the given query in the specified scope and returns a collection of management objects that match the query in a ManagementObjectCollection.

ManagementOperationObserver

管理异步操作和处理异步接收的管理信息和事件。Manages asynchronous operations and handles management information and events received asynchronously.

ManagementOptions

为所有选项对象提供抽象基类。Provides an abstract base class for all options objects.

ManagementPath

提供一个包装,用于分析和生成 WMI 对象的路径。Provides a wrapper for parsing and building paths to WMI objects.

ManagementQuery

提供所有管理查询对象的抽象基类。Provides an abstract base class for all management query objects.

ManagementScope

表示管理操作的范围(命名空间)。Represents a scope (namespace) for management operations.

MethodData

包含关于 WMI 方法的信息。Contains information about a WMI method.

MethodDataCollection

表示在集合中可用的方法集。Represents the set of methods available in the collection.

MethodDataCollection.MethodDataEnumerator

表示 MethodDataCollection 中的 MethodData 对象的枚举数。Represents the enumerator for MethodData objects in the MethodDataCollection.

ObjectGetOptions

指定用于获取管理对象的选项。Specifies options for getting a management object.

ObjectPutEventArgs

保存 ObjectPut 事件的事件数据。Holds event data for the ObjectPut event.

ObjectQuery

表示返回实例或类的管理查询。Represents a management query that returns instances or classes.

ObjectReadyEventArgs

保存 ObjectReady 事件的事件数据。Holds event data for the ObjectReady event.

ProgressEventArgs

保存 Progress 事件的事件数据。Holds event data for the Progress event.

PropertyData

表示关于 WMI 属性的信息。Represents information about a WMI property.

PropertyDataCollection

表示 WMI 对象的属性集。Represents the set of properties of a WMI object.

PropertyDataCollection.PropertyDataEnumerator

表示 PropertyDataCollection 中的 PropertyData 对象的枚举数。Represents the enumerator for PropertyData objects in the PropertyDataCollection.

PutOptions

指定用于提交管理对象更改的选项。Specifies options for committing management object changes.

QualifierData

包含关于 WMI 限定符的信息。Contains information about a WMI qualifier.

QualifierDataCollection

表示 QualifierData 对象集合。Represents a collection of QualifierData objects.

QualifierDataCollection.QualifierDataEnumerator

表示 QualifierDataCollection 中的 QualifierData 对象的枚举数。Represents the enumerator for QualifierData objects in the QualifierDataCollection.

RelatedObjectQuery

表示 WQL ASSOCIATORS OF 数据查询。Represents a WQL ASSOCIATORS OF data query. 它可以用于实例查询和架构查询。It can be used for both instances and schema queries.

RelationshipQuery

表示 WQL REFERENCES OF 数据查询。Represents a WQL REFERENCES OF data query.

SelectQuery

表示 WQL SELECT 数据查询。Represents a WQL SELECT data query.

StoppedEventArgs

保存 Stopped 事件的事件数据。Holds event data for the Stopped event.

WqlEventQuery

表示 WQL 格式的 WMI 事件查询。Represents a WMI event query in WQL format.

WqlObjectQuery

表示 WQL 格式的 WMI 数据。Represents a WMI data query in WQL format.

枚举

AuthenticationLevel

描述连接到 WMI 所使用的身份验证级别。 它用于到 WMI 的 COM 连接。This is used for the COM connection to WMI.

CimType

描述属性、限定符或方法参数的可能 CIM 类型。Describes the possible CIM types for properties, qualifiers, or method parameters.

CodeLanguage

定义代码生成器支持的语言。Defines the languages supported by the code generator.

ComparisonSettings

描述可以用于 CompareTo(ManagementBaseObject, ComparisonSettings) 的对象比较模式。Describes the object comparison modes that can be used with CompareTo(ManagementBaseObject, ComparisonSettings). 注意,这些值可以组合。Note that these values may be combined.

ImpersonationLevel

描述连接到 WMI 时将使用的模拟级别。Describes the impersonation level to be used to connect to WMI.

ManagementStatus

描述当前定义的所有 WMI 错误代码的枚举。Describes the enumeration of all WMI error codes that are currently defined.

PutType

描述当使用 Put() 时将对象保存到 WMI 的可能效果。Describes the possible effects of saving an object to WMI when using Put().

TextFormat

描述可以用于 GetText(TextFormat) 的可能的文本格式。Describes the possible text formats that can be used with GetText(TextFormat).

委托

CompletedEventHandler

表示用来处理 Completed 事件的方法。Represents the method that will handle the Completed event.

EventArrivedEventHandler

表示用来处理 EventArrived 事件的方法。Represents the method that will handle the EventArrived event.

ObjectPutEventHandler

表示用来处理 ObjectPut 事件的方法。Represents the method that will handle the ObjectPut event.

ObjectReadyEventHandler

表示用来处理 ObjectReady 事件的方法。Represents the method that will handle the ObjectReady event.

ProgressEventHandler

表示用来处理 Progress 事件的方法。Represents the method that will handle the Progress event.

StoppedEventHandler

表示用来处理 Stopped 事件的方法。Represents the method that will handle the Stopped event.