ManagementClass.Methods Property

 

Gets or sets a collection of MethodData objects that represent the methods defined in the WMI class.

Namespace:   System.Management
Assembly:  System.Management (in System.Management.dll)

Public ReadOnly Property Methods As MethodDataCollection

Property Value

Type: System.Management.MethodDataCollection

A MethodDataCollection representing the methods defined in the WMI class.

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

The following example shows how to initialize a ManagementClass variable with a ManagementClass constructor and then get all the methods in the WMI class passed into the constructor.

Imports System
Imports System.Management

Public Class Sample

    Public Shared Function Main(ByVal args() _
        As String) As Integer

        Dim c As New ManagementClass("Win32_Process")
        Dim m As MethodData
        For Each m In c.Methods
            Console.WriteLine( _
                "This class contains this method : {0}", m.Name)
        Next m

        Return 0
    End Function
End Class

.NET Framework
Available since 1.1
Return to top
Show: