GetMethod Method (String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Searches for the public method with the specified name.

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

public MethodInfo GetMethod(
	string name
)

Parameters

name
Type: System..::..String
The string containing the name of the public method to get.

Return Value

Type: System.Reflection..::..MethodInfo
An object that represents the public method with the specified name, if found; otherwise, nullNothingnullptrunita null reference (Nothing in Visual Basic).

The search for name is case-sensitive. The search includes public static and public instance methods.

If the current Type represents a constructed generic type, this method returns the MethodInfo with the type parameters replaced by the appropriate type arguments.

If the current Type represents a type parameter in the definition of a generic type or generic method, this method searches the methods of the class constraint, or the methods of Object if there is no class constraint.

Show: