MethodData MethodData MethodData MethodData Class

定義

WMI (Windows Management Instrumentation) メソッドに関する情報を格納します。Contains information about a WMI method.

public ref class MethodData
public class MethodData
type MethodData = class
Public Class MethodData
継承
MethodDataMethodDataMethodDataMethodData

次の例では、 MethodDataクラスを使用して、 Win32_Processメソッドに関する情報を一覧表示します。The following example lists information about the Win32_Process.Create method using the MethodData class. Win32_Processクラスの詳細については、 Windows Management Instrumentationのドキュメントを参照してください。For more information on the Win32_Process class, see the Windows Management Instrumentation documentation.

using System;
using System.Management;

public class Sample 
{    
    public static void Main() 
    {

        // Get the WMI class
        ManagementClass processClass = 
            new ManagementClass("Win32_Process");
        processClass.Options.UseAmendedQualifiers = true;

        // Get the methods in the class
        MethodDataCollection methods =
            processClass.Methods;

        // display the method names
        Console.WriteLine("Method Name: ");
        foreach (MethodData method in methods)
        {
            if(method.Name.Equals("Create"))
            {
                Console.WriteLine(method.Name);
                Console.WriteLine("Description: " +
                    method.Qualifiers["Description"].Value);
                Console.WriteLine();

                Console.WriteLine("In-parameters: ");
                foreach(PropertyData i in 
                    method.InParameters.Properties)
                {
                    Console.WriteLine(i.Name);
                }
                Console.WriteLine();

                Console.WriteLine("Out-parameters: ");
                foreach(PropertyData o in 
                    method.OutParameters.Properties)
                {
                    Console.WriteLine(o.Name);
                }
                Console.WriteLine();

                Console.WriteLine("Qualifiers: ");
                foreach(QualifierData q in 
                    method.Qualifiers)
                {
                    Console.WriteLine(q.Name);
                }
                Console.WriteLine();
  
            }
        } 
    }
}
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

プロパティ

InParameters InParameters InParameters InParameters

このメソッドの入力パラメーターを取得します。Gets the input parameters to the method. 各パラメーターは、オブジェクトにプロパティとして記述されます。Each parameter is described as a property in the object. パラメーターが入出力両用の場合は、InParameters プロパティと OutParameters プロパティの両方に表示されます。If a parameter is both in and out, it appears in both the InParameters and OutParameters properties.

Name Name Name Name

メソッドの名前を取得します。Gets the name of the method.

Origin Origin Origin Origin

クラス継承階層でメソッドが最初に導入された管理クラスの名前を取得します。Gets the name of the management class in which the method was first introduced in the class inheritance hierarchy.

OutParameters OutParameters OutParameters OutParameters

このメソッドの出力パラメーターを取得します。Gets the output parameters to the method. 各パラメーターは、オブジェクトにプロパティとして記述されます。Each parameter is described as a property in the object. パラメーターが入出力両用の場合は、InParameters プロパティと OutParameters プロパティの両方に表示されます。If a parameter is both in and out, it will appear in both the InParameters and OutParameters properties.

Qualifiers Qualifiers Qualifiers Qualifiers

メソッドで定義された修飾子のコレクションを取得します。Gets a collection of qualifiers defined in the method. 各要素は型 QualifierData であり、修飾子の名前、値、フレーバーなどの情報を格納します。Each element is of type QualifierData and contains information such as the qualifier name, value, and flavor.

メソッド

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

適用対象