Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

PropertyData Class

Represents information about a WMI property.

For a list of all members of this type, see PropertyData Members.


[Visual Basic]
Public Class PropertyData
public class PropertyData
public __gc class PropertyData
public class PropertyData

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


using System;
using System.Management;

// This sample displays all properties that qualifies the "DeviceID" property
// in Win32_LogicalDisk.DeviceID='C' instance.
class Sample_PropertyData
    public static int Main(string[] args) {
        ManagementObject disk =
            new ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"");
        PropertyData diskProperty = disk.Properties["DeviceID"];
        Console.WriteLine("Name: " + diskProperty.Name);
        Console.WriteLine("Type: " + diskProperty.Type);
        Console.WriteLine("Value: " + diskProperty.Value);
        Console.WriteLine("IsArray: " + diskProperty.IsArray);
        Console.WriteLine("IsLocal: " + diskProperty.IsLocal);
        Console.WriteLine("Origin: " + diskProperty.Origin);
        return 0;
[Visual Basic] 
Imports System
Imports System.Management

' This sample displays all properties that qualifies the "DeviceID" property
' in Win32_LogicalDisk.DeviceID='C' instance.
Class Sample_PropertyData
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim disk As New ManagementObject("Win32_LogicalDisk.DeviceID=""C:""")
        Dim diskProperty As PropertyData = disk.Properties("DeviceID")
        Console.WriteLine("Name: " & diskProperty.Name)
        Console.WriteLine("Type: " & diskProperty.Type)
        Console.WriteLine("Value: " & diskProperty.Value)
        Console.WriteLine("IsArray: " & diskProperty.IsArray)
        Console.WriteLine("IsLocal: " & diskProperty.IsLocal)
        Console.WriteLine("Origin: " & diskProperty.Origin)
        Return 0
    End Function
End Class

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.Management

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Management (in System.Management.dll)

See Also

PropertyData Members | System.Management Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.