C#遍历字典Dictionary

C#遍历字典Dictionary

 List<string> list_key = new List<string>();
            foreach (var str_value in dictionary_mc_agv_name)
            {
                if (str_value.Value == "JIAZHI2")
                {

                    list_key.Add(str_value.Key);
                }
            }
            for (int i = 0; i < list_key.Count; ++i)
            {
                dictionary_mc_agv_name.Remove(list_key[i]);
            }
            jiazhi_agv2_state = "idle";

 

posted @ 2023-01-30 10:16  txwtech  阅读(116)  评论(0编辑  收藏  举报