PrincipalCollection.CopyTo(Principal[], Int32) 方法

定义

从数组中指定的位置索引开始,将 Principal 对象从此 PrincipalCollection 复制到指定的数组中。Copies the Principal objects from this PrincipalCollection into the specified array, starting at the specified position index in array.

public:
 virtual void CopyTo(cli::array <System::DirectoryServices::AccountManagement::Principal ^> ^ array, int index);
public void CopyTo (System.DirectoryServices.AccountManagement.Principal[] array, int index);
abstract member CopyTo : System.DirectoryServices.AccountManagement.Principal[] * int -> unit
override this.CopyTo : System.DirectoryServices.AccountManagement.Principal[] * int -> unit
Public Sub CopyTo (array As Principal(), index As Integer)

参数

array
Principal[]

应使用 Array 对象填充的 PrincipalThe Array that should be populated with Principal objects.

index
Int32

应将集合中的第一个主体对象复制到其中的 array 中的位置。The position in array into which the first principal object in the collection should be copied.

注解

array 必须为一维。array must be one-dimensional. 如果不是,则会引发 ArgumentExceptionIf it is not, an ArgumentException is thrown. 如果要复制的元素数大于从 index 到 @no__t 的末尾的可用空间(如果 @no__t @no__t 为-2,则为; 如果 @no__t 大于0,则会引发更多异常。Further exceptions are thrown if the number of elements to copy is greater than the available space from index to the end of array, if array is null, or if index is less than 0.

适用于