在C#中使用foreach遍历hashtable哈希表
using System; using System.Collection; namespace HashSampleApplication1 { class Program { static void Main() { Hashtable hash = new Hashtable(); hashtable[1] = "kaka"; hashtable[2] = "biryani"; hashtable[13] = "kadai"; foreach (string key in hash.Keys) { Console.WriteLine(key + ‘=’ + hash[key]); } } } }