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

Hastable 用法及循环读取

WBOY
WBOY原創
2016-06-06 20:01:211034瀏覽

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