ArrayRecord.GetArray(Type, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public Array GetArray(Type expectedArrayType, bool allowNulls = true);
public Array GetArray(Type expectedArrayType, bool allowNulls = true);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")>]
member this.GetArray : Type * bool -> Array
member this.GetArray : Type * bool -> Array
Public Function GetArray (expectedArrayType As Type, Optional allowNulls As Boolean = true) As Array
參數
- expectedArrayType
- Type
預期陣列類型。
- allowNulls
- Boolean
true允許null陣列內有數值;否則,。 false
傳回
一個陣列,裡面充滿序列化記錄中提供的資料。
- 屬性
例外狀況
expectedArrayType 與有效載荷資料不符。
備註
在呼叫此方法之前,請利用 屬性 Lengths 檢查陣列的總長度。 攻擊者可能發送了一個需要分配非常大型陣列的小型有效載荷,這可能導致 OutOfMemoryException 拒絕服務。