ManagementBaseObject.SystemProperties 屬性

定義

取得管理物件的 WMI 系統屬性集合 (,例如類別名稱、伺服器和命名空間) 。 WMI 系統屬性名稱開頭為 "__"。

public:
 virtual property System::Management::PropertyDataCollection ^ SystemProperties { System::Management::PropertyDataCollection ^ get(); };
public virtual System.Management.PropertyDataCollection SystemProperties { get; }
member this.SystemProperties : System.Management.PropertyDataCollection
Public Overridable ReadOnly Property SystemProperties As PropertyDataCollection

屬性值

集合,包含管理物件的系統屬性。

範例

下列範例會 SystemProperties 使用 屬性來顯示 Win32_Process 類別的系統屬性名稱和值。 如需 Win32_Process 類別的詳細資訊,請參閱 Windows Management Instrumentation 檔。

using System;
using System.Management;

public class Sample
{
    public static void Main()
    {

        // Get the WMI class
        ManagementClass processClass =
            new ManagementClass("Win32_Process");

        // Get the system properties for the class
        PropertyDataCollection properties =
            processClass.SystemProperties;

        // display the properties
        foreach (PropertyData p in properties)
        {
            Console.WriteLine(p.Name);
            Console.WriteLine(p.Value);
            Console.WriteLine();
        }
    }
}
Imports System.Management


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

        ' Get the WMI class
        Dim processClass As New ManagementClass( _
            "Win32_Process")

        ' Get the system properties for the class
        Dim properties As PropertyDataCollection
        properties = processClass.SystemProperties

        For Each p As PropertyData In properties

            Console.WriteLine(p.Name)
            Console.WriteLine(p.Value)
            Console.WriteLine()

        Next
    End Function
End Class

備註

屬性值

PropertyDataCollection 表示管理物件的系統屬性。

.NET Framework 安全性

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

適用於