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.

public ref class ManagementClass : System::Management::ManagementObject
[System.Serializable]
public class ManagementClass : System.Management.ManagementObject
type ManagementClass = class
    inherit ManagementObject
Public Class ManagementClass
Inherits ManagementObject
继承
属性

构造函数

ManagementClass()

初始化 ManagementClass 类的新实例。Initializes a new instance of the ManagementClass class. 这就是无参数构造函数。This is the parameterless constructor.

ManagementClass(ManagementPath)

初始化 ManagementClass 类的新实例。Initializes a new instance of the ManagementClass class. 该类表示 WMI 中的一个公共信息模型 (CIM) 管理类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 有关详细信息,请参阅 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.

ManagementClass(ManagementPath, ObjectGetOptions)

使用指定选项初始化 ManagementClass 类的一个新实例,将其初始化到给定的 WMI 类路径。Initializes a new instance of the ManagementClass class initialized to the given WMI class path using the specified options. 该类表示 WMI 中的一个公共信息模型 (CIM) 管理类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 有关详细信息,请参阅 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.

ManagementClass(ManagementScope, ManagementPath, ObjectGetOptions)

在指定的范围内,使用指定选项为指定的 WMI 类初始化 ManagementClass 类的一个新实例。Initializes a new instance of the ManagementClass class for the specified WMI class in the specified scope and with the specified options. 该类表示 WMI 中的一个公共信息模型 (CIM) 管理类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 有关详细信息,请参阅 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.

ManagementClass(SerializationInfo, StreamingContext)

ManagementClassSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the ManagementClass class from the specified instances of the SerializationInfo and StreamingContext classes.

ManagementClass(String)

初始化 ManagementClass 类的一个新实例,将其初始化到给定路径。Initializes a new instance of the ManagementClass class initialized to the given path. 该类表示 WMI 中的一个公共信息模型 (CIM) 管理类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 有关详细信息,请参阅 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.

ManagementClass(String, ObjectGetOptions)

使用指定选项初始化 ManagementClass 类的一个新实例,将其初始化到给定的 WMI 类路径。Initializes a new instance of the ManagementClass class initialized to the given WMI class path using the specified options. 该类表示 WMI 中的一个公共信息模型 (CIM) 管理类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 有关详细信息,请参阅 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.

ManagementClass(String, String, ObjectGetOptions)

在指定的范围内,使用指定选项为指定的 WMI 类初始化 ManagementClass 类的新实例。Initializes a new instance of the ManagementClass class for the specified WMI class, in the specified scope, and with the specified options. 该类表示 WMI 中的一个公共信息模型 (CIM) 管理类,如“Win32_LogicalDisk”和“Win32_Process”,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. 有关详细信息,请参阅 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.

属性

CanRaiseEvents

获取一个指示组件是否可以引发事件的值。Gets a value indicating whether the component can raise an event.

(继承自 Component)
ClassPath

获取或设置对象的类的路径。Gets or sets the path to the object's class.

(继承自 ManagementObject)
Container

获取 IContainer,它包含 ComponentGets the IContainer that contains the Component.

(继承自 Component)
Derivation

获取一个数组,该数组包含继承层次结构中从该类到层次结构顶部的所有 WMI 类。Gets an array containing all WMI classes in the inheritance hierarchy from this class to the top of the hierarchy.

DesignMode

获取一个值,用以指示 Component 当前是否处于设计模式。Gets a value that indicates whether the Component is currently in design mode.

(继承自 Component)
Events

获取附加到此 Component 的事件处理程序的列表。Gets the list of event handlers that are attached to this Component.

(继承自 Component)
Item[String]

通过 [] 符获取对属性值的访问。Gets access to property values through [] notation. 此属性是 ManagementBaseObject 类的索引器。This property is the indexer for the ManagementBaseObject class. 您可以使用由某个类型定义的默认索引属性,但不能显式定义自己的属性。You can use the default indexed properties defined by a type, but you cannot explicitly define your own. 但是,在某个类上指定 expando 特性将自动提供一个类型为 Object、索引类型为 String 的默认索引属性。However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

(继承自 ManagementBaseObject)
Methods

获取或设置 MethodData 对象的集合,这些对象表示 WMI 类中定义的方法。Gets or sets a collection of MethodData objects that represent the methods defined in the WMI class.

Options

获取或设置检索对象时要使用的其他信息。Gets or sets additional information to use when retrieving the object.

(继承自 ManagementObject)
Path

获取或设置 ManagementClass 对象绑定到的 WMI 类的路径。Gets or sets the path of the WMI class to which the ManagementClass object is bound.

Properties

获取描述管理对象属性的 PropertyData 对象的集合。Gets a collection of PropertyData objects describing the properties of the management object.

(继承自 ManagementBaseObject)
Qualifiers

获取管理对象中定义的 QualifierData 对象的集合。Gets the collection of QualifierData objects defined on the management object. 集合中的每个元素均包含限定符名称、值和风格等信息。Each element in the collection holds information such as the qualifier name, value, and flavor.

(继承自 ManagementBaseObject)
Scope

获取或设置此对象在其中驻留的范围。Gets or sets the scope in which this object resides.

(继承自 ManagementObject)
Site

获取或设置 ISiteComponentGets or sets the ISite of the Component.

(继承自 Component)
SystemProperties

获取管理对象的 WMI 系统属性的集合(例如,类名、服务器和命名空间)。Gets the collection of WMI system properties of the management object (for example, the class name, server, and namespace). WMI 系统属性名以“”开头。WMI system property names begin with "".

(继承自 ManagementBaseObject)

方法

Clone()

返回对象的一个副本。Returns a copy of the object.

CompareTo(ManagementBaseObject, ComparisonSettings)

根据指定的选项,将此对象与另一对象进行比较。Compares this object to another, based on specified options.

(继承自 ManagementBaseObject)
CopyTo(ManagementOperationObserver, ManagementPath)

将该对象异步复制到另一个位置。Copies the object to a different location, asynchronously.

(继承自 ManagementObject)
CopyTo(ManagementOperationObserver, ManagementPath, PutOptions)

将该对象异步复制到另一个位置。Copies the object to a different location, asynchronously.

(继承自 ManagementObject)
CopyTo(ManagementOperationObserver, String)

将该对象异步复制到另一个位置。Copies the object to a different location, asynchronously.

(继承自 ManagementObject)
CopyTo(ManagementOperationObserver, String, PutOptions)

将该对象异步复制到另一个位置。Copies the object to a different location, asynchronously.

(继承自 ManagementObject)
CopyTo(ManagementPath)

将对象复制到另一个位置。Copies the object to a different location.

(继承自 ManagementObject)
CopyTo(ManagementPath, PutOptions)

将对象复制到另一个位置。Copies the object to a different location.

(继承自 ManagementObject)
CopyTo(String)

将对象复制到另一个位置。Copies the object to a different location.

(继承自 ManagementObject)
CopyTo(String, PutOptions)

将对象复制到另一个位置。Copies the object to a different location.

(继承自 ManagementObject)
CreateInstance()

初始化 WMI 类的新实例。Initializes a new instance of the WMI class.

CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Delete()

删除对象。Deletes the object.

(继承自 ManagementObject)
Delete(DeleteOptions)

删除对象。Deletes the object.

(继承自 ManagementObject)
Delete(ManagementOperationObserver)

删除对象。Deletes the object.

(继承自 ManagementObject)
Delete(ManagementOperationObserver, DeleteOptions)

删除对象。Deletes the object.

(继承自 ManagementObject)
Derive(String)

从此类派生新类。Derives a new class from this class.

Dispose()

释放由该组件使用的所有资源。Releases all resources used by the Component.

(继承自 ManagementObject)
Dispose(Boolean)

释放 Component 使用的非托管资源,并选择性地释放托管资源。Releases the unmanaged resources used by the Component and optionally releases the managed resources.

(继承自 Component)
Equals(Object)

比较两个管理对象。Compares two management objects.

(继承自 ManagementBaseObject)
Get()

将 WMI 类信息绑定到管理对象。Binds WMI class information to the management object.

(继承自 ManagementObject)
Get(ManagementOperationObserver)

异步绑定到管理对象。Binds to the management object asynchronously.

(继承自 ManagementObject)
GetHashCode()

充当特定类型的哈希函数,适用于哈希算法以及哈希表之类的数据结构中。Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

(继承自 ManagementBaseObject)
GetInstances()

返回该类的所有实例的集合。Returns the collection of all instances of the class.

GetInstances(EnumerationOptions)

使用指定选项返回该类的所有实例的集合。Returns the collection of all instances of the class using the specified options.

GetInstances(ManagementOperationObserver)

异步返回包含该类的所有实例的集合。Returns the collection of all instances of the class, asynchronously.

GetInstances(ManagementOperationObserver, EnumerationOptions)

使用指定选项异步返回包含类的所有实例的集合。Returns the collection of all instances of the class, asynchronously, using the specified options.

GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetMethodParameters(String)

返回一个 ManagementBaseObject,它表示方法的输入参数的列表。Returns a ManagementBaseObject representing the list of input parameters for a method.

(继承自 ManagementObject)
GetObjectData(SerializationInfo, StreamingContext)

用反序列化此实例所表示的字段所必需的数据填充 SerializationInfoPopulates a SerializationInfo with the data necessary to deserialize the field represented by this instance.

GetPropertyQualifierValue(String, String)

返回指定的属性限定符的值。Returns the value of the specified property qualifier.

(继承自 ManagementBaseObject)
GetPropertyValue(String)

获取某属性值的等效访问器。Gets an equivalent accessor to a property's value.

(继承自 ManagementBaseObject)
GetQualifierValue(String)

获取指定的限定符的值。Gets the value of the specified qualifier.

(继承自 ManagementBaseObject)
GetRelated()

获取与该对象(联系对象)相关的对象的集合。Gets a collection of objects related to the object (associators).

(继承自 ManagementObject)
GetRelated(ManagementOperationObserver)

异步获取与该对象(联系对象)相关的对象的集合。Gets a collection of objects related to the object (associators) asynchronously. 此调用会立即返回,并且会在结果可用时调用委托。This call returns immediately, and a delegate is called when the results are available.

(继承自 ManagementObject)
GetRelated(ManagementOperationObserver, String)

获取与该对象(联系对象)相关的对象的集合。Gets a collection of objects related to the object (associators).

(继承自 ManagementObject)
GetRelated(ManagementOperationObserver, String, String, String, String, String, String, Boolean, EnumerationOptions)

获取与该对象(联系对象)相关的对象的集合。Gets a collection of objects related to the object (associators).

(继承自 ManagementObject)
GetRelated(String)

获取与该对象(联系对象)相关的对象的集合。Gets a collection of objects related to the object (associators).

(继承自 ManagementObject)
GetRelated(String, String, String, String, String, String, Boolean, EnumerationOptions)

获取与该对象(联系对象)相关的对象的集合。Gets a collection of objects related to the object (associators).

(继承自 ManagementObject)
GetRelatedClasses()

检索与 WMI 类相关的类。Retrieves classes related to the WMI class.

GetRelatedClasses(ManagementOperationObserver)

异步检索与 WMI 类相关的类。Retrieves classes related to the WMI class, asynchronously.

GetRelatedClasses(ManagementOperationObserver, String)

给定相关的类名,异步检索与 WMI 类相关的类。Retrieves classes related to the WMI class, asynchronously, given the related class name.

GetRelatedClasses(ManagementOperationObserver, String, String, String, String, String, String, EnumerationOptions)

使用指定选项异步检索与 WMI 相关的类。Retrieves classes related to the WMI class, asynchronously, using the specified options.

GetRelatedClasses(String)

检索与 WMI 类相关的类。Retrieves classes related to the WMI class.

GetRelatedClasses(String, String, String, String, String, String, EnumerationOptions)

根据指定选项检索与 WMI 类相关的类。Retrieves classes related to the WMI class based on the specified options.

GetRelationshipClasses()

检索使此类与其他类相关的关系类。Retrieves relationship classes that relate the class to others.

GetRelationshipClasses(ManagementOperationObserver)

异步检索使此类与其他类相关的关系类。Retrieves relationship classes that relate the class to others, asynchronously.

GetRelationshipClasses(ManagementOperationObserver, String)

异步检索使此类与指定的 WMI 相关的关系类。Retrieves relationship classes that relate the class to the specified WMI class, asynchronously.

GetRelationshipClasses(ManagementOperationObserver, String, String, String, EnumerationOptions)

根据指定选项以异步方式检索与该类相关的关系类。Retrieves relationship classes that relate the class according to the specified options, asynchronously.

GetRelationshipClasses(String)

检索使此类与其他类相关的关系类,其中,终结点类是指定的类。Retrieves relationship classes that relate the class to others, where the endpoint class is the specified class.

GetRelationshipClasses(String, String, String, EnumerationOptions)

根据指定选项检索使此类与其他类相关的关系类。Retrieves relationship classes that relate this class to others, according to specified options.

GetRelationships()

获取该对象的关联的集合。Gets a collection of associations to the object.

(继承自 ManagementObject)
GetRelationships(ManagementOperationObserver)

获取该对象的关联的集合。Gets a collection of associations to the object.

(继承自 ManagementObject)
GetRelationships(ManagementOperationObserver, String)

获取该对象的关联的集合。Gets a collection of associations to the object.

(继承自 ManagementObject)
GetRelationships(ManagementOperationObserver, String, String, String, Boolean, EnumerationOptions)

获取该对象的关联的集合。Gets a collection of associations to the object.

(继承自 ManagementObject)
GetRelationships(String)

获取该对象的关联的集合。Gets a collection of associations to the object.

(继承自 ManagementObject)
GetRelationships(String, String, String, Boolean, EnumerationOptions)

获取该对象的关联的集合。Gets a collection of associations to the object.

(继承自 ManagementObject)
GetService(Type)

返回一个对象,该对象表示由 Component 或它的 Container 提供的服务。Returns an object that represents a service provided by the Component or by its Container.

(继承自 Component)
GetStronglyTypedClassCode(Boolean, Boolean)

为给定的 WMI 类生成强类型类。Generates a strongly-typed class for a given WMI class.

GetStronglyTypedClassCode(CodeLanguage, String, String)

为给定的 WMI 类生成强类型类。Generates a strongly-typed class for a given WMI class. 此函数生成 Visual Basic、C#、JScript、J# 或 C++ 的代码,具体情况取决于输入参数。This function generates code for Visual Basic, C#, JScript, J#, or C++ depending on the input parameters.

GetSubclasses()

返回类的所有子类的集合。Returns the collection of all subclasses for the class.

GetSubclasses(EnumerationOptions)

使用指定选项检索类的子类。Retrieves the subclasses of the class using the specified options.

GetSubclasses(ManagementOperationObserver)

异步返回从该类派生的所有类的集合。Returns the collection of all classes derived from this class, asynchronously.

GetSubclasses(ManagementOperationObserver, EnumerationOptions)

使用指定选项异步检索从该类派生的所有类。Retrieves all classes derived from this class, asynchronously, using the specified options.

GetText(TextFormat)

以指定的格式返回对象的文本化表示形式。Returns a textual representation of the object in the specified format.

(继承自 ManagementBaseObject)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
InvokeMethod(ManagementOperationObserver, String, ManagementBaseObject, InvokeMethodOptions)

对对象异步调用方法。Invokes a method on the object, asynchronously.

(继承自 ManagementObject)
InvokeMethod(ManagementOperationObserver, String, Object[])

对对象异步调用方法。Invokes a method on the object, asynchronously.

(继承自 ManagementObject)
InvokeMethod(String, ManagementBaseObject, InvokeMethodOptions)

对 WMI 对象调用方法。Invokes a method on the WMI object. 输入和输出参数表示为 ManagementBaseObject 对象。The input and output parameters are represented as ManagementBaseObject objects.

(继承自 ManagementObject)
InvokeMethod(String, Object[])

对对象调用方法。Invokes a method on the object.

(继承自 ManagementObject)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
Put()

提交对对象所做的更改。Commits the changes to the object.

(继承自 ManagementObject)
Put(ManagementOperationObserver)

异步提交对对象所做的更改。Commits the changes to the object, asynchronously.

(继承自 ManagementObject)
Put(ManagementOperationObserver, PutOptions)

使用指定的选项异步提交对对象所做的更改。Commits the changes to the object asynchronously and using the specified options.

(继承自 ManagementObject)
Put(PutOptions)

提交对对象所做的更改。Commits the changes to the object.

(继承自 ManagementObject)
SetPropertyQualifierValue(String, String, Object)

设置指定的属性限定符的值。Sets the value of the specified property qualifier.

(继承自 ManagementBaseObject)
SetPropertyValue(String, Object)

设置指定属性的值。Sets the value of the named property.

(继承自 ManagementBaseObject)
SetQualifierValue(String, Object)

设置指定的限定符的值。Sets the value of the named qualifier.

(继承自 ManagementBaseObject)
ToString()

返回对象的完整路径。Returns the full path of the object. 这是对默认对象实现的重写。This is an override of the default object implementation.

(继承自 ManagementObject)

事件

Disposed

当通过调用 Dispose() 方法释放组件时发生。Occurs when the component is disposed by a call to the Dispose() method.

(继承自 Component)

显式接口实现

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

实现 ISerializable 接口,并返回序列化 ManagementBaseObject 所需的数据。Implements the ISerializable interface and returns the data needed to serialize the ManagementBaseObject.

(继承自 ManagementBaseObject)

适用于