Using Collection in C#

来源:互联网 发布:天下游定位软件 编辑:程序博客网 时间:2024/06/14 19:53
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Collections.Specialized;public partial class calc : System.Web.UI.Page{    NameValueCollection d;    protected void Page_Load(object sender, EventArgs e)    {        d = new NameValueCollection();        d.Add("a1", "wao1");        d.Add("a2", "wao2");        d.Add("a3", "wao3");    }    protected void Button1_Click(object sender, EventArgs e)    {            System.Collections.IEnumerator ie = d.GetEnumerator();        String key;        while (ie.MoveNext())        {            key = ie.Current.ToString();            ListBox1.Items.Add(key + ":" + d.Get(key));        }            }}


原创粉丝点击