ClassSystem.Collections.Hashtable SyntaxhashtableVariable.CopyTo(array, arrayIndex)
DescriptionThe CopyTo method copies hashtable key/value pairs into an existing array, starting at a specified array index. The array must use the DictionaryEntry structure for its type; this structure includes members for both keys and values. Usage at a Glance
ExampleThe sample code copies hashtable pairs to an array. Dim nameTable As New Hashtable Dim stateArray( ) As DictionaryEntry ' ----- Build the hashtable. nameTable.Add("Ch", "Chopin") nameTable.Add("Mo", "Mozart") nameTable.Add("Be", "Beethoven") ReDim stateArray(nameTable.Count - 1) nameTable.CopyTo(stateArray, 0) See AlsoHashtable Class, Hashtable.Keys Property |