public static string StortJson(string json)
{
    var dic = JsonConvert.DeserializeObject<SortedDictionary<string, object>>(json);
    SortedDictionary<string, object> keyValues = new SortedDictionary<string, object>(dic);
    keyValues.OrderBy(m => m.Value);//升序
    //keyValues.OrderByDescending(m => m.Key);//降序
    return JsonConvert.SerializeObject(keyValues);
}
//把Json字符串转换成Dictionary对象
    var objJson = JsonConvert.DeserializeObject<Dictionary<string, object>>(paramJson);
    //签名字符串
    string sign = secrectKey;
    foreach (var temp in objJson)
    {
        sign += temp.Key + temp.Value;
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2022-12-23
  • 2021-12-21
  • 2022-02-09
  • 2021-11-25
  • 2022-12-23
相关资源
相似解决方案