共用方式為


IReflect.GetMethod Method (String, BindingFlags, Binder, array<Type[], array<ParameterModifier[])

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Retrieves a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods.

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

Syntax

'Declaration
Function GetMethod ( _
    name As String, _
    bindingAttr As BindingFlags, _
    binder As Binder, _
    types As Type(), _
    modifiers As ParameterModifier() _
) As MethodInfo
MethodInfo GetMethod(
    string name,
    BindingFlags bindingAttr,
    Binder binder,
    Type[] types,
    ParameterModifier[] modifiers
)

Parameters

  • types
    Type: array<System.Type[]
    An array used to choose among overloaded methods.
  • modifiers
    Type: array<System.Reflection.ParameterModifier[]
    An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.

Return Value

Type: System.Reflection.MethodInfo
The requested method that matches all the specified parameters.

Exceptions

Exception Condition
AmbiguousMatchException

The object implements multiple methods with the same name.

Remarks

The return value is a match based on the method name, BindingFlags enum member, the kind of type conversion specified by the binder parameter, the overload, and the ParameterInfo that describes the signature of the method.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.