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

EnumerationOptions Class

Provides a base class for query and enumeration-related options objects.

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

System.Object
   System.Management.ManagementOptions
      System.Management.EnumerationOptions

[Visual Basic]
Public Class EnumerationOptions
   Inherits ManagementOptions
[C#]
public class EnumerationOptions : ManagementOptions
[C++]
public __gc class EnumerationOptions : public ManagementOptions
[JScript]
public class EnumerationOptions extends ManagementOptions

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 example demonstrates how to enumerate all top-level WMI classes
// and subclasses in root/cimv2 namespace.
class Sample_EnumerationOptions
{
    public static int Main(string[] args) {
        ManagementClass newClass = new ManagementClass();
        EnumerationOptions options = new EnumerationOptions();
        options.EnumerateDeep = false;
        foreach(ManagementObject o in newClass.GetSubclasses(options)) {
            Console.WriteLine(o["__Class"]);
        }
        return 0;
    }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This example demonstrates how to enumerate all top-level WMI classes
' and subclasses in root/cimv2 namespace.
Class Sample_EnumerationOptions
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim newClass As New ManagementClass()
        Dim options As New EnumerationOptions()
        options.EnumerateDeep = False
        Dim o As ManagementObject
        For Each o In newClass.GetSubclasses(options)
            Console.WriteLine(o("__Class"))
        Next o
        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

EnumerationOptions Members | System.Management Namespace

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