/// <summary> /// 通过Dictionary key值获取对应value /// </summary> public string GetValueByKey(Dictionary<string, string> dic,string key) { string result = ""; foreach (KeyValuePair<string, string> kvp in dic) { if (kvp.Key.Equals(key)) { result = kvp.Value; break; } } eturn result; }
原文地址:https://www.cnblogs.com/yu-shang/p/12161960.html
时间: 2024-10-04 16:09:03