Export (0) Print
Expand All

ManagementClass Class

Represents a management class.

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

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Management.ManagementBaseObject
            System.Management.ManagementObject
               System.Management.ManagementClass

[Visual Basic]
<Serializable>
Public Class ManagementClass
   Inherits ManagementObject
[C#]
[Serializable]
public class ManagementClass : ManagementObject
[C++]
[Serializable]
public __gc class ManagementClass : public ManagementObject
[JScript]
public
   Serializable
class ManagementClass extends ManagementObject

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 getting information about a class using the ManagementClass object
class Sample_ManagementClass
{
    public static int Main(string[] args) {
        ManagementClass diskClass = new ManagementClass("Win32_LogicalDisk");
        diskClass.Get();
        Console.WriteLine("Logical Disk class has " + diskClass.Properties.Count + " properties");
        return 0;
    }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This example demonstrates getting information about a class using the ManagementClass object
Class Sample_ManagementClass
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim diskClass As New ManagementClass("Win32_LogicalDisk")
        diskClass.Get()
        Console.WriteLine(("Logical Disk class has " & _
                           diskClass.Properties.Count.ToString() & _
                           " properties"))
        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

ManagementClass Members | System.Management Namespace

Show:
© 2014 Microsoft