Retrieves a MethodInfo object corresponding to a specified method, and a type array is used to choose among overloaded methods with the same name.
[Visual Basic] Overloads Function GetMethod( _ ByVal name As String, _ ByVal bindingAttr As BindingFlags, _ ByVal binder As Binder, _ ByVal types() As Type, _ ByVal modifiers() As ParameterModifier _ ) As MethodInfo [C#] MethodInfo GetMethod( string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers ); [C++] MethodInfo* GetMethod( String* name, BindingFlags bindingAttr, Binder* binder, Type* types[], ParameterModifier* modifiers[] ) = 0; [JScript] function GetMethod( name : String, bindingAttr : BindingFlags, binder : Binder, types : Type[], modifiers : ParameterModifier[] ) : MethodInfo;
The requested method.
Exception Type | Condition |
---|---|
AmbiguousMatchException | If the object implements multiple methods with the same name. |
The GetMethod method retrieves a MethodInfo object corresponding to a specified method, and a type array is used to choose among overloaded methods with the same name.An example of a binding attribute value is IgnoreCase. The return value is a match is based upon the name and System.Reflection.DescriptorInfo which describes the signature of the method.
IReflect Interface | IReflect Members | System.Reflection Namespace | IReflect.GetMethod Overload List | String | BindingFlags | Binder | Type | ParameterModifier