語言

CompilerErrorCollection.CopyTo(CompilerError[], Int32) 方法

定義

將集合值複製到指定索引的一維 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 所指示的陣列是多維的。

-或-

中 CompilerErrorCollection 元素的數量大於陣列與端點之間的 index 可用空間,該點由 array表示。

參數 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)

適用於

另請參閱