Leggere in inglese Modifica

Condividi tramite


QualifierData Class

Definition

Contains information about a WMI qualifier.

public class QualifierData
Inheritance
QualifierData

Examples

The following example lists qualifier information about the Win32_Service class using the QualifierData class. 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);
    }
}

Properties

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.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)