共用方式為


ServiceDescriptionFormatExtensionCollection.CopyTo(Object[], Int32) 方法

定義

複製整個 ServiceDescriptionFormatExtensionCollectionServiceDescriptionFormatExtension 型別的一維陣列,從目標陣列的指定以零起始的索引位置開始。

public:
 void CopyTo(cli::array <System::Object ^> ^ array, int index);
public void CopyTo (object[] array, int index);
member this.CopyTo : obj[] * int -> unit
Public Sub CopyTo (array As Object(), index As Integer)

參數

array
Object[]

ServiceDescriptionFormatExtension 型別的陣列,做為複製動作目的端。

index
Int32

以零起始的索引,要於此處開始放置複製的集合。

範例

// Copy elements of collection to an Object array.
array<Object^>^myObjectArray2 = gcnew array<Object^>(myCollection->Count);
myCollection->CopyTo( myObjectArray2, 0 );
Console::WriteLine( "Collection elements are copied to an object array." );
// Copy elements of collection to an Object array.
Object[] myObjectArray2 = new Object[myCollection.Count];
myCollection.CopyTo(myObjectArray2,0);
Console.WriteLine("Collection elements are copied to an object array.");
' Copy elements of collection to an Object array.
Dim myObjectArray2(myCollection.Count -1 ) As Object
myCollection.CopyTo(myObjectArray2, 0)
Console.WriteLine("Collection elements are copied to an object array.")

適用於