Marshal.NumParamBytes(MethodInfo) 方法

定義

計算要儲存指定方法的參數而在 unmanaged 記憶體中所需的位元組數目。

public:
 static int NumParamBytes(System::Reflection::MethodInfo ^ m);
public static int NumParamBytes (System.Reflection.MethodInfo m);
[System.Security.SecurityCritical]
public static int NumParamBytes (System.Reflection.MethodInfo m);
static member NumParamBytes : System.Reflection.MethodInfo -> int
[<System.Security.SecurityCritical>]
static member NumParamBytes : System.Reflection.MethodInfo -> int
Public Shared Function NumParamBytes (m As MethodInfo) As Integer

參數

m
MethodInfo

要檢查的方法。

傳回

在 Unmanaged 記憶體中表示方法參數所需的位元組數目。

屬性

例外狀況

m 參數為 null

m 參數不是 MethodInfo 物件。

備註

方法會 NumParamBytes 以位元組為單位傳回堆疊大小 (,) 表示 Unmanaged 記憶體中方法簽章的參數。

請注意,這個方法的傳回值與平臺相關。 例如,具有單一整數參數的簽章會在 32 位平臺上傳回 4 的值,而 64 位平臺上的值為 8。

適用於