欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

Hastable 用法及循环读取

程序员文章站 2022-05-15 09:07:47
...

string strlist = ""; Hashtable hastable = new Hashtable(); hastable.Add("chen", "5"); hastable.Add("jian", "6"); hastable.Add("ping", "7"); IDictionaryEnumerator hsEnum = hastable.GetEnumerator(); while (hsEnum.MoveNext()) { strlist += hsE

string strlist = "";

Hashtable hastable = new Hashtable();

hastable.Add("chen", "5");
hastable.Add("jian", "6");
hastable.Add("ping", "7");

IDictionaryEnumerator hsEnum = hastable.GetEnumerator();
while (hsEnum.MoveNext())
{
strlist += hsEnum.Value.ToString() + hsEnum.Key.ToString();
}

Response.Write(strlist);