MethodData Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Contains information about a WMI method.

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

System.Object
  System.Management.MethodData

Public Class MethodData

NameDescription
System_CAPS_pubpropertyInParameters

Gets the input parameters to the method. Each parameter is described as a property in the object. If a parameter is both in and out, it appears in both the InParameters and OutParameters properties.

System_CAPS_pubpropertyName

Gets the name of the method.

System_CAPS_pubpropertyOrigin

Gets the name of the management class in which the method was first introduced in the class inheritance hierarchy.

System_CAPS_pubpropertyOutParameters

Gets the output parameters to the method. Each parameter is described as a property in the object. If a parameter is both in and out, it will appear in both the InParameters and OutParameters properties.

System_CAPS_pubpropertyQualifiers

Gets a collection of qualifiers defined in the method. Each element is of type QualifierData and contains information such as the qualifier name, value, and flavor.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The following example lists information about the Win32_Process.Create method using the MethodData class. For more information on the Win32_Process class, see the Windows Management Instrumentation documentation in the MSDN Library at http://msdn.microsoft.com/library.

Imports System
Imports System.Management


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

        ' Get the WMI class
        Dim processClass As ManagementClass = _
            New ManagementClass("Win32_Process")
        processClass.Options.UseAmendedQualifiers = True

        ' Get the methods in the class
        Dim methods As MethodDataCollection = _
            processClass.Methods

        ' display the method names
        Console.WriteLine("Method Name: ")
        For Each method As MethodData In methods

            If (method.Name.Equals("Create")) Then

                Console.WriteLine(method.Name)
                Console.WriteLine("Description: " & _
                    method.Qualifiers("Description").Value)
                Console.WriteLine()

                Console.WriteLine("In-parameters: ")
                For Each i As PropertyData In _
                    method.InParameters.Properties

                    Console.WriteLine(i.Name)
                Next
                Console.WriteLine()

                Console.WriteLine("Out-parameters: ")
                For Each o As PropertyData In _
                    method.OutParameters.Properties

                    Console.WriteLine(o.Name)
                Next
                Console.WriteLine()

                Console.WriteLine("Qualifiers: ")
                For Each q As QualifierData In _
                    method.Qualifiers

                    Console.WriteLine(q.Name)
                Next
                Console.WriteLine()

            End If
        Next

    End Function 'Main
End Class 'Sample

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: