PropertyData 클래스

정의

WMI 속성에 대한 정보를 나타냅니다.

public ref class PropertyData
public class PropertyData
type PropertyData = class
Public Class PropertyData
상속
PropertyData

예제

다음 예제에 대 한 정보를 나열 합니다 Win32_OperatingSystem 를 사용 하 여 클래스를 PropertyData 클래스. Win32_OperatingSystem 대한 자세한 내용은 Windows Management Instrumentation 설명서를 참조하세요.

using System;
using System.Management;

public class Sample
{
    public static void Main()
    {

        // Get the WMI class
        ManagementClass osClass =
            new ManagementClass("Win32_OperatingSystem");

        osClass.Options.UseAmendedQualifiers = true;

        // Get the Properties in the class
        PropertyDataCollection properties =
            osClass.Properties;

        // display the Property names
        Console.WriteLine("Property Name: ");
        foreach (PropertyData property in properties)
        {
            Console.WriteLine(
                "---------------------------------------");
            Console.WriteLine(property.Name);
            Console.WriteLine("Description: " +
                property.Qualifiers["Description"].Value);
            Console.WriteLine();

            Console.WriteLine("Type: ");
            Console.WriteLine(property.Type);

            Console.WriteLine();

            Console.WriteLine("Qualifiers: ");
            foreach(QualifierData q in
                property.Qualifiers)
            {
                Console.WriteLine(q.Name);
            }
            Console.WriteLine();

            foreach (ManagementObject c in osClass.GetInstances())
            {
                Console.WriteLine("Value: ");
                Console.WriteLine(
                    c.Properties[property.Name.ToString()].Value);

                Console.WriteLine();
            }
        }
    }
}
Imports System.Management


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

        ' Get the WMI class
        Dim osClass As ManagementClass = _
            New ManagementClass("Win32_OperatingSystem")

        osClass.Options.UseAmendedQualifiers = True

        ' Get the Properties in the class
        Dim properties As PropertyDataCollection = _
            osClass.Properties

        ' display the Property names
        Console.WriteLine("Property Name: ")
        For Each p As PropertyData In properties

            Console.WriteLine( _
                "---------------------------------------")
            Console.WriteLine(p.Name)
            Console.WriteLine("Description: " & _
                p.Qualifiers("Description").Value)
            Console.WriteLine()

            Console.WriteLine("Type: ")
            Console.WriteLine(p.Type)

            Console.WriteLine()

            Console.WriteLine("Qualifiers: ")
            For Each q As QualifierData In _
                p.Qualifiers

                Console.WriteLine(q.Name)
            Next
            Console.WriteLine()

            For Each c As ManagementObject In osClass.GetInstances()

                Console.WriteLine("Value: ")
                Console.WriteLine( _
                    c.Properties(p.Name.ToString()).Value)

                Console.WriteLine()
            Next
        Next

    End Function
End Class

속성

IsArray

속성이 배열인지 여부를 나타내는 값을 가져옵니다.

IsLocal

속성이 현재 WMI 클래스에 정의되었는지 여부를 나타내는 값을 가져옵니다.

Name

속성 이름을 가져옵니다.

Origin

계층 구조에서 속성이 정의된 WMI 클래스의 이름을 가져옵니다.

Qualifiers

속성에 정의된 한정자 집합을 가져옵니다.

Type

속성의 CIM 형식을 가져옵니다.

Value

속성의 현재 값을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상