ManagementClass.Derivation 屬性

定義

取得陣列,包含繼承階層架構 (Inheritance Hierarchy) 中從這個類別到階層架構最上層的所有 WMI 類別。

public:
 property System::Collections::Specialized::StringCollection ^ Derivation { System::Collections::Specialized::StringCollection ^ get(); };
public System.Collections.Specialized.StringCollection Derivation { get; }
member this.Derivation : System.Collections.Specialized.StringCollection
Public ReadOnly Property Derivation As StringCollection

屬性值

StringCollection

字串集合,包含繼承階層架構中這個類別的所有 WMI 類別名稱。

範例

下列範例示範如何使用建構函式初始化 ManagementClass 變數 ManagementClass ,然後從傳遞至建構函式的 WMI 類別中取得繼承階層中的所有類別,到階層頂端。

using System;
using System.Management;

public class Example
{
    public static void Main()
    {
        ManagementClass c =
            new ManagementClass("Win32_LogicalDisk");
        foreach (string s in c.Derivation)
            Console.WriteLine("Further derived from : {0}", s);

        return;
    }
}
Imports System.Management

Public Class Sample

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

        Dim c As New ManagementClass("Win32_LogicalDisk")
        Dim s As String
        For Each s In c.Derivation
            Console.WriteLine("Further derived from : " & s)
        Next

        Return 0
    End Function
End Class

備註

這個屬性是唯讀的。

.NET Framework 安全性

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

適用於