Dictionary<int,string>怎么获取它的值的集合
1个回答
2016-09-02
展开全部
C# code
Dictionary<String, String> dic = new Dictionary<String, String>();
dic.Add("1", "one");
dic.Add("2", "two");
dic.Add("3", "three");
Dictionary<String,String>.KeyCollection keys = dic.Keys;
foreach (String s in keys)
Console.WriteLine(s);
Dictionary<String, String>.ValueCollection values = dic.Values;
foreach (String s in values)
Console.WriteLine(s);
Dictionary<String, String> dic = new Dictionary<String, String>();
dic.Add("1", "one");
dic.Add("2", "two");
dic.Add("3", "three");
Dictionary<String,String>.KeyCollection keys = dic.Keys;
foreach (String s in keys)
Console.WriteLine(s);
Dictionary<String, String>.ValueCollection values = dic.Values;
foreach (String s in values)
Console.WriteLine(s);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询