This documentation is archived and is not being maintained.

ManagementClass Constructor

.NET Framework 1.1

Initializes a new instance of the ManagementClass class.

Overload List

Initializes a new instance of the ManagementClass class. This is the default constructor.

[Visual Basic] Public Sub New()
[C#] public ManagementClass();
[C++] public: ManagementClass();
[JScript] public function ManagementClass();

Initializes a new instance of the ManagementClass class initialized to the given path.

[Visual Basic] Public Sub New(ManagementPath)
[C#] public ManagementClass(ManagementPath);
[C++] public: ManagementClass(ManagementPath*);
[JScript] public function ManagementClass(ManagementPath);

Initializes a new instance of the ManagementClass class initialized to the given path.

[Visual Basic] Public Sub New(String)
[C#] public ManagementClass(string);
[C++] public: ManagementClass(String*);
[JScript] public function ManagementClass(String);

Initializes a new instance of the ManagementClass class initialized to the given WMI class path using the specified options.

[Visual Basic] Public Sub New(ManagementPath, ObjectGetOptions)
[C#] public ManagementClass(ManagementPath, ObjectGetOptions);
[C++] public: ManagementClass(ManagementPath*, ObjectGetOptions*);
[JScript] public function ManagementClass(ManagementPath, ObjectGetOptions);

Initializes a new instance of the ManagementClass class initialized to the given WMI class path using the specified options.

[Visual Basic] Public Sub New(String, ObjectGetOptions)
[C#] public ManagementClass(string, ObjectGetOptions);
[C++] public: ManagementClass(String*, ObjectGetOptions*);
[JScript] public function ManagementClass(String, ObjectGetOptions);

Initializes a new instance of the ManagementClass class for the specified WMI class in the specified scope and with the specified options.

[Visual Basic] Public Sub New(ManagementScope, ManagementPath, ObjectGetOptions)
[C#] public ManagementClass(ManagementScope, ManagementPath, ObjectGetOptions);
[C++] public: ManagementClass(ManagementScope*, ManagementPath*, ObjectGetOptions*);
[JScript] public function ManagementClass(ManagementScope, ManagementPath, ObjectGetOptions);

Initializes a new instance of the ManagementClass class for the specified WMI class, in the specified scope, and with the specified options.

[Visual Basic] Public Sub New(String, String, ObjectGetOptions)
[C#] public ManagementClass(string, string, ObjectGetOptions);
[C++] public: ManagementClass(String*, String*, ObjectGetOptions*);
[JScript] public function ManagementClass(String, String, ObjectGetOptions);

Example

[Visual Basic, C#] Note   This example shows how to use one of the overloaded versions of the ManagementClass constructor. For other examples that might be available, see the individual overload topics.
[C#] 
ManagementClass c = new ManagementClass("\\\\MyBox\\root\\cimv2", 
                                                    "Win32_Environment", 
                                                    new ObjectGetOptions(null, true));
               
[Visual Basic] 
Dim c As New ManagementClass("\\MyBox\root\cimv2", _
                                         "Win32_Environment", _
                                         new ObjectGetOptions(Null, True))
               

[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.

See Also

ManagementClass Class | ManagementClass Members | System.Management Namespace

Show: