C# – how to create , store and retrieve the values from hash table in c#

chashtable

How to create , store and retrieve the values from hash table in c#?

Best Answer

Have a look at

'

Hashtable hashtable = new Hashtable();
hashtable[1] = "One";
hashtable[2] = "Two";
hashtable[13] = "Thirteen";

foreach (DictionaryEntry entry in hashtable)
{
    Console.WriteLine("{0}, {1}", entry.Key, entry.Value);
}