QualifierData 类

定义

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

public ref class QualifierData
public class QualifierData
type QualifierData = class
Public Class QualifierData
继承
QualifierData

示例

下面的示例使用QualifierData类列出有关Win32_Service类的限定符信息。The following example lists qualifier information about the Win32_Service class using the QualifierData class. 有关Win32_Service的详细信息, 请参阅Windows Management Instrumentation文档。For more information about Win32_Service, see the Windows Management Instrumentation documentation.

using System;
using System.Management;

public class Sample 
{    
    public static void Main() 
    {
        // Get the WMI class
        ManagementClass mClass = 
            new ManagementClass("Win32_Service");

        mClass.Options.UseAmendedQualifiers = true;

        // Get the Qualifiers for the class
        QualifierDataCollection qualifiers =
            mClass.Qualifiers;

        // display the Qualifier names
        Console.WriteLine(mClass.ClassPath.ClassName +
            " Qualifiers: ");
        foreach (QualifierData q in qualifiers)
        {
            Console.WriteLine(q.Name);
        }
        Console.WriteLine();
        
        Console.WriteLine("Class Description: ");
        Console.WriteLine(
            mClass.Qualifiers["Description"].Value);
    }
}
Imports System.Management


Public Class Sample
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer

        ' Get the WMI class
        Dim mClass As ManagementClass = _
            New ManagementClass("Win32_Service")

        mClass.Options.UseAmendedQualifiers = True

        ' Get the Qualifiers for the class
        Dim qualifiers As QualifierDataCollection = _
            mClass.Qualifiers()

        ' display the Qualifier names
        Console.WriteLine(mClass.ClassPath.ClassName & _
            " Qualifiers: ")
        For Each q As QualifierData In qualifiers
            Console.WriteLine(q.Name)
        Next

        Console.WriteLine()

        Console.WriteLine("Class Description: ")
        Console.WriteLine( _
            mClass.Qualifiers("Description").Value)


    End Function
End Class

属性

IsAmended

获取或设置一个值,该值指示限定符是否已修正。Gets or sets a value indicating whether the qualifier is amended.

IsLocal

获取一个值,该值指示限定符是在此类上本地定义的还是从基类传播的。Gets a value indicating whether the qualifier has been defined locally on this class or has been propagated from a base class.

IsOverridable

获取或设置一个值,该值指示在传播时限定符的值是否可以重写。Gets or sets a value indicating whether the value of the qualifier can be overridden when propagated.

Name

表示限定符的名称。Represents the name of the qualifier.

PropagatesToInstance

获取或设置一个值,该值指示是否将限定符传播给类的实例。Gets or sets a value indicating whether the qualifier should be propagated to instances of the class.

PropagatesToSubclass

获取或设置一个值,该值指示是否将限定符传播给类的子类。Gets or sets a value indicating whether the qualifier should be propagated to subclasses of the class.

Value

获取或设置限定符的值。Gets or sets the value of the qualifier.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于