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
返回
用序列化记录中提供的数据填充的数组。
- 属性
例外
expectedArrayType 与有效负载中的数据不匹配。
注解
在调用此方法之前,请使用 Lengths 属性检查数组的总长度。 攻击者可能发送了一个小有效负载,该有效负载需要分配非常大的数组,这可能会导致 OutOfMemoryException 和拒绝服务。