CompilerErrorCollection.CopyTo(CompilerError[], Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將集合值複製到指定索引的一維 Array 實例。
public:
void CopyTo(cli::array <System::CodeDom::Compiler::CompilerError ^> ^ array, int index);
public void CopyTo(System.CodeDom.Compiler.CompilerError[] array, int index);
member this.CopyTo : System.CodeDom.Compiler.CompilerError[] * int -> unit
Public Sub CopyTo (array As CompilerError(), index As Integer)
參數
- array
- CompilerError[]
一維 Array ,即從 中複製 CompilerErrorCollection的值的目的地。
- index
- Int32
陣列中的索引,從那裡開始複製。
例外狀況
參數 array 為 null。
參數 index 小於參數 array 所指示陣列的下界。
範例
以下範例示範如何使用此 CopyTo 方法將 a CompilerErrorCollection 的內容複製到陣列,從指定的索引值開始。
// Copies the contents of the collection, beginning at index 0,
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo( errors, 0 );
' Copies the contents of the collection, beginning at index 0,
' to the specified CompilerError array.
' 'errors' is a CompilerError array.
collection.CopyTo(errors, 0)