Dictionary——通过value找Key

Dictionary<string, string> dic = GetRoleDescriptions();
string key = dic.FirstOrDefault(x => x.Value == ddlSearchRoleDes.SelectedItem.Text.Trim().ToUpper()).Key;

posted @ 2013-06-20 22:58  stevejson  阅读(555)  评论(0编辑  收藏  举报