This documentation is archived and is not being maintained.

X509CertificateCollection.CopyTo Method

Copies the X509Certificate values in the current X509CertificateCollection to a one-dimensional Array instance at the specified index.

[Visual Basic]
Public Sub CopyTo( _
   ByVal array() As X509Certificate, _
   ByVal index As Integer _
public void CopyTo(
 X509Certificate[] array,
 int index
public: void CopyTo(
 X509Certificate* array[],
 int index
public function CopyTo(
   array : X509Certificate[],
 index : int


The one-dimensional Array that is the destination of the values copied from X509CertificateCollection.
The index into array to begin copying.


Exception Type Condition
ArgumentException The array parameter is multidimensional.


The number of elements in the X509CertificateCollection is greater than the available space between arrayIndex and the end of array.

ArgumentNullException The array parameter is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeException The arrayIndex parameter is less than the array parameter's lower bound.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

X509CertificateCollection Class | X509CertificateCollection Members | System.Security.Cryptography.X509Certificates Namespace | Array