在C#中使用foreach遍历hashtable哈希表的代码
如下的代码内容是关于在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]); } } }}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。