Using Collection in C#
2011-11-11 00:00
246 查看
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)); } } }
相关文章推荐
- Convert objects to JSON in C# using JavaScriptSerializer
- Convert objects to JSON in C# using JavaScriptSerializer
- Using MongoDB in C#
- How to close (auto hide) WPF window after 10 sec using a timer in C#?
- Using Attributes in C#
- Creating Collection Classes in C#
- trouble shoot about using BindLayer in MapX with C# [原创]
- Business Object Validation Using Attributes in C#
- Using Property Grid in C#
- Serialize and deserialize objects as Xml using generic types in C# 2.0
- [存底]使用C#压缩/解压缩7-zip文件 zip/Unzip file using 7-zip in C#
- Exception handling with custom error pages in ASP.NET using C#.
- 在C#中直接使用Open API的方法 / A Method of Using Open API in C#
- Remove row from generic datatable in C#(The given DataRow is not in the current DataRowCollection)
- [转]Using Pointers in C#
- modify is ambiguous in Mapped Statements collection (try using the full name including the namespace
- [Tip]dispose resource in C++/CLI using a C# class
- Simple Messenger Developed in .NET Using C#
- Create a Windows Clipboard Monitor in C# using SetClipboardViewer
- 投票程序2 图像识别 Using The Office 2007 OCR Component in C#