Dictionary<int,string>怎么获取它的值的集合

2024-12-30 01:33:23
推荐回答(1个)
回答1:

Dictionary dict = new Dictionary();
//便利值
foreach (string value in dict.Values)
{
//value
}
//遍历键
foreach (int key in dict.Keys)
{
//key
}