Dictionary<string, decimal?> dic = GetDic(); //获取一个自定义的字典类 //获取键名 string[] keys = dic.Keys.ToArray(); var k=keys[i]; //键 k //值 dic[k]