QualifierData.Value 属性

定义

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

public:
 property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
public object Value { get; set; }
member this.Value : obj with get, set
Public Property Value As Object

属性值

返回一个 Object 值,该值包含限定符的值。Returns an Object value containing the value of the qualifier.

示例

下面的示例使用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

注解

限定符只能为以下 CIM 类型子集: string、uint16、uint32、sint32、uint64、sint64、real32、real64 或 bool。Qualifiers can only be of the following subset of CIM types: string, uint16, uint32, sint32, uint64, sint64, real32, real64, or bool.

属性值Property Value

限定符的值。The value of the qualifier.

.NET Framework 安全性.NET Framework Security

对直接调用方的完全信任。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.

适用于