首页 >php教程 >php手册 >Hastable 用法及循环读取

Hastable 用法及循环读取

WBOY
WBOY原创
2016-06-06 20:01:211035浏览

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);

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn