This documentation is archived and is not being maintained.

PropertyDataCollection.PropertyDataEnumerator Class

Represents the enumerator for PropertyData objects in the PropertyDataCollection.

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


[Visual Basic]
Public Class PropertyDataCollection.PropertyDataEnumerator
   Implements IEnumerator
public class PropertyDataCollection.PropertyDataEnumerator :
public __gc class PropertyDataCollection.PropertyDataEnumerator :
   public IEnumerator
public class PropertyDataCollection.PropertyDataEnumerator
   implements IEnumerator

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 demonstrates how to enumerate all properties in a 
// ManagementObject using the PropertyDataEnumerator object. 
class Sample_PropertyDataEnumerator 
    public static int Main(string[] args) { 
        ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID='C:'");
        PropertyDataCollection.PropertyDataEnumerator propertyEnumerator = disk.Properties.GetEnumerator();
        while(propertyEnumerator.MoveNext()) {
            PropertyData p = (PropertyData)propertyEnumerator.Current;
            Console.WriteLine("Property found: " + p.Name);
        return 0;
[Visual Basic] 
Imports System
Imports System.Management

' This sample demonstrates how to enumerate all properties in a
' ManagementObject using PropertyDataEnumerator object.
Class Sample_PropertyDataEnumerator
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim disk As New ManagementObject("Win32_LogicalDisk.DeviceID='C:'")
        Dim propertyEnumerator As _
          PropertyDataCollection.PropertyDataEnumerator = disk.Properties.GetEnumerator()
        While propertyEnumerator.MoveNext()
            Dim p As PropertyData = _
                CType(propertyEnumerator.Current, PropertyData)
            Console.WriteLine("Property found: " & p.Name)
         End While
         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

PropertyDataCollection.PropertyDataEnumerator Members | System.Management Namespace