Compartir a través de


Type.GetMethod Method (String, Type[])

Searches for the specified public method whose parameters match the specified argument types.

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

Syntax

[MethodImplAttribute]
public MethodInfo GetMethod (
         string name,
         Type[] types
)

Parameters

  • name
    The String object containing the name of the method you want to get.

  • types
    An array of Type objects representing the number, order, and type of the parameters for the method you want to get.

    -or-

    An empty Type array (that is, Type[] types = new Type[0]) you can use to get a method that takes no parameters.

Return Value

A MethodInfo object representing the method whose parameters match the specified argument types, if such a match is found; otherwise, a null reference.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

Type Class
Type Members
System Namespace