Click or drag to resize
TypeGetMethod Method (String, Type)
Searches for the specified public method whose parameters match the specified argument types.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public MethodInfo GetMethod(
	string name,
	Type[] types
)

Parameters

name
Type: SystemString
The string containing the name of the public method to get.
types
Type: SystemType
An array of Type objects representing the number, order, and type of the parameters for the method to get.-or- An empty array of Type objects (as provided by the EmptyTypes field) to get a method that takes no parameters.

Return Value

Type: MethodInfo
An object representing the public method whose parameters match the specified argument types, if found; otherwise, null.
Exceptions
ExceptionCondition
AmbiguousMatchExceptionMore than one method is found with the specified name and specified parameters.
ArgumentNullExceptionname is null.-or- types is null.-or- One of the elements in types is null.
ArgumentExceptiontypes is multidimensional.
See Also