RuntimeHelpers.Box(Byte, RuntimeTypeHandle) 方法

定義

從位於目標參考的資料中建立指定類型的盒裝物件。

public:
 static System::Object ^ Box(System::Byte % target, RuntimeTypeHandle type);
public static object? Box(ref byte target, RuntimeTypeHandle type);
static member Box : byte * RuntimeTypeHandle -> obj
Public Shared Function Box (ByRef target As Byte, type As RuntimeTypeHandle) As Object

參數

target
Byte

目標資料。

type
RuntimeTypeHandle

要製作的盒子類型。

傳回

一個包含指定資料的盒裝物件。

例外狀況

指定的型別 handle 為 null

指定的類型不能建立一個盒裝實例。

傳遞入型態是類似byref型態。

適用於