MethodBase.GetMethodFromHandle 方法

定義

使用指定的控制代碼取得方法資訊。

多載

GetMethodFromHandle(RuntimeMethodHandle)

利用方法的內部中繼資料表示 (控制代碼) 取得方法資訊。

GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)

針對指定的泛型型別,取得指定的控制代碼所表示之建構函式或方法的 MethodBase 物件。

GetMethodFromHandle(RuntimeMethodHandle)

來源:
MethodBase.CoreCLR.cs
來源:
MethodBase.CoreCLR.cs
來源:
MethodBase.CoreCLR.cs

利用方法的內部中繼資料表示 (控制代碼) 取得方法資訊。

public:
 static System::Reflection::MethodBase ^ GetMethodFromHandle(RuntimeMethodHandle handle);
public static System.Reflection.MethodBase GetMethodFromHandle (RuntimeMethodHandle handle);
public static System.Reflection.MethodBase? GetMethodFromHandle (RuntimeMethodHandle handle);
static member GetMethodFromHandle : RuntimeMethodHandle -> System.Reflection.MethodBase
Public Shared Function GetMethodFromHandle (handle As RuntimeMethodHandle) As MethodBase

參數

handle
RuntimeMethodHandle

方法的控制代碼。

傳回

MethodBase,包含方法的相關資訊。

例外狀況

handle 無效。

備註

句柄只有在取得這些句柄的應用程式域中才有效。

適用於

GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle)

來源:
MethodBase.CoreCLR.cs
來源:
MethodBase.CoreCLR.cs
來源:
MethodBase.CoreCLR.cs

針對指定的泛型型別,取得指定的控制代碼所表示之建構函式或方法的 MethodBase 物件。

public:
 static System::Reflection::MethodBase ^ GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
public static System.Reflection.MethodBase GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
public static System.Reflection.MethodBase? GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
[System.Runtime.InteropServices.ComVisible(false)]
public static System.Reflection.MethodBase GetMethodFromHandle (RuntimeMethodHandle handle, RuntimeTypeHandle declaringType);
static member GetMethodFromHandle : RuntimeMethodHandle * RuntimeTypeHandle -> System.Reflection.MethodBase
[<System.Runtime.InteropServices.ComVisible(false)>]
static member GetMethodFromHandle : RuntimeMethodHandle * RuntimeTypeHandle -> System.Reflection.MethodBase
Public Shared Function GetMethodFromHandle (handle As RuntimeMethodHandle, declaringType As RuntimeTypeHandle) As MethodBase

參數

handle
RuntimeMethodHandle

建構函式或方法之內部中繼資料表示的控制代碼。

declaringType
RuntimeTypeHandle

定義建構函式或方法之泛型型別的控制代碼。

傳回

MethodBase 物件,在 handle 所指定的泛型型別中,表示 declaringType 指定的方法或建構函式。

屬性

例外狀況

handle 無效。

備註

句柄只有在取得這些句柄的應用程式域中才有效。

RuntimeMethodHandle 型型別之建構函式或方法的結構可以代表不同的 MethodBase 對象,視泛型型別參數所指定的類型而定。 例如,如果在 class G<T> Visual Basic generic <T> ref class G 中 (class G(Of T),在 C++ 中) 有傳回型T別的方法,MethodBaseG<int>建構類別中該方法的物件與泛型類型定義中該方法的物件不同MethodBase

適用於