Copies the Hashtable values into a one-dimensional Array instance at the specified index.
[Visual Basic] Overridable Public Sub CopyTo( _ ByVal array As Array, _ ByVal arrayIndex As Integer _ ) [C#] public virtual void CopyTo( Array array, int arrayIndex ); [C++] public: virtual void CopyTo( Array* array, int arrayIndex ); [JScript] public function CopyTo( array : Array, arrayIndex : int );
None.
Exception Type | Condition |
---|---|
ArgumentException | array is multidimensional.
-or- The number of elements in the Hashtable is greater than the available space between arrayIndex and the end of array. |
ArgumentNullException | array is a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | arrayIndex is less than array 's lowbound. |
This method can be overridden by a derived class. CopyTo only copies the values in the Hashtable, not the keys.
The elements copied to the Array are sorted in the same order that the Hashtable 's enumerator iterates through the Hashtable.
Hashtable Class | Hashtable Members | System.Collections Namespace | Array | GetEnumerator