[Solved] Get all keys from Hashtable


You can iterate through HashTable keys as:

foreach(object key in hashTable.Keys)
{
   Console.WriteLine(String.Format("{0}: {1}", key, hashTable[key]));
}

Or you can also do as below:

foreach(DictionaryEntry entry in hashtable)
{
    Console.WriteLine(entry.Key + ":" + entry.Value);
}

0

solved Get all keys from Hashtable