Bearbeiten

Freigeben über


DirectoryAttribute.CopyTo(Object[], Int32) Method

Definition

The CopyTo(Object[], Int32) method copies the entire collection to a one-dimensional array, starting at the specified index of the target array.

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)

Parameters

array
Object[]

A one-dimensional array that is the destination of the elements copied from the DirectoryAttribute object.

index
Int32

The zero-based index of array where the copying begins.

Exceptions

array contains a null reference (Nothing in Visual Basic).

index is less than zero.

This exception can occur under one of the following conditions:

  • array is multidimensional.

  • index is equal to, or greater than, the length of array.

  • The number of elements in the source DirectoryControlCollection is greater than the space available from index to the end of the destination array.

The type of the source DirectoryControlCollection cannot be cast automatically to the type of the destination array.

Applies to