怎么获取Dictionary<int, string>的值?
我知道这个是键值对的,我知道可以根据key得到value,但关键是现在连key也不知道啊
就是想让这个显示在listbox中,应该怎么显示啊,在线等!!!!

1 //Ada
2 Dictionary<int, string> dic = new Dictionary<int, string>();
3   dic.Add(1, "A");
4   dic.Add(2, "B");
5   foreach (string s in dic.Values)
6   {
7   this.listBox1.Items.Add(s);
8   }

 

相关文章:

  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-07-21
  • 2022-01-23
  • 2021-07-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案