Hashtable ht = new Hashtable();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ht.Add("北京", "010");
ht.Add("上海", "021");
ht.Add("广州", "020");
}
private void button1_Click(object sender, EventArgs e)
{
foreach (DictionaryEntry a in ht)
{
string msg = "Key=" + a.Key.ToString() + " Value=" + a.Value.ToString();
this.listBox1.Items.Add(msg);
}
}