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

PropertyDataCollection Class

Represents the set of properties of a WMI object.

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

System.Object
   System.Management.PropertyDataCollection

[Visual Basic]
Public Class PropertyDataCollection
   Implements ICollection, IEnumerable
[C#]
public class PropertyDataCollection : ICollection, IEnumerable
[C++]
public __gc class PropertyDataCollection : public ICollection,
   IEnumerable
[JScript]
public class PropertyDataCollection implements ICollection,
   IEnumerable

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.

Example

[C#] 
using System; 
using System.Management; 

// This sample demonstrates how to enumerate properties 
// in a ManagementObject object.
class Sample_PropertyDataCollection 
{ 
    public static int Main(string[] args) {
        ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid = \"c:\""); 
        PropertyDataCollection diskProperties = disk.Properties;
        foreach (PropertyData diskProperty in diskProperties) {
            Console.WriteLine("Property = " + diskProperty.Name);
        }
        return 0;
    }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This sample demonstrates how to enumerate properties
' in a ManagementObject object.
Class Sample_PropertyDataCollection
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim disk As New ManagementObject("win32_logicaldisk.deviceid=""c:""")
        Dim diskProperties As PropertyDataCollection = disk.Properties
        Dim diskProperty As PropertyData
        For Each diskProperty In diskProperties
            Console.WriteLine("Property = " & diskProperty.Name)
        Next diskProperty
        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.

Requirements

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

PropertyDataCollection Members | System.Management Namespace

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