ArrayRecord.GetArray(Type, Boolean) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
[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
Parametrar
- expectedArrayType
- Type
Förväntad matristyp.
- allowNulls
- Boolean
trueför att tillåta null värden i matrisen, annars . false
Returer
En matris fylld med data som anges i de serialiserade posterna.
- Attribut
Undantag
expectedArrayType matchar inte data från nyttolasten.
Kommentarer
Innan du anropar den här metoden kontrollerar du matrisens totala längd med hjälp Lengths av egenskapen . En angripare kan ha skickat en liten nyttolast som kräver allokering av en mycket stor matris, vilket kan orsaka OutOfMemoryException och överbelastning.