QualifierData.Value Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the value of the qualifier.

Namespace:   System.Management
Assembly:  System.Management (in System.Management.dll)

public object Value { get; set; }

Property Value

Type: System.Object

Returns an Object value containing the value of the qualifier.

Qualifiers can only be of the following subset of CIM types: string, uint16, uint32, sint32, uint64, sint64, real32, real64, or bool.

The value of the qualifier.

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

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 in the MSDN Library at http://msdn.microsoft.com/library.

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);
    }
}

.NET Framework
Available since 1.1
Return to top
Show: