Loop Each Item of HashTable

Akiii
Posted by Akiii under C# category on | Points: 40 | Views : 1169
class Program
{
static void Main(string[] args)
{
Hashtable EmpHashTable = new Hashtable();
EmpHashTable.Add("Key1", "Anirban");
EmpHashTable.Add("Key2", "Sharad");
EmpHashTable.Add("Key3", "Akiii");
string str = string.Empty;

foreach (DictionaryEntry HE in EmpHashTable)
{
str += ", " + HE.Key + " - " + HE.Value;
}
Console.Write(str);
Console.ReadLine();
}
}




Thanks and Regards
Akiii

Comments or Responses

Login to post response