共用方式為


QualifierData.Name 屬性

定義

表示限定詞的名稱。

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

屬性值

傳回 String 值,包含限定詞的名稱。

範例

下列範例會使用 QualifierData 類別列出Win32_Service類別的限定符資訊。 如需 Win32_Service的詳細資訊,請參閱 Windows Management Instrumentation 檔。

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

備註

屬性值

限定符的名稱。

.NET Framework 安全性

完全信任立即呼叫者。 這個成員無法供部分信任的程式碼使用。 如需詳細資訊,請參閱 使用部分信任程式代碼的連結庫

適用於