Json字符串转Dictionary

  /// <summary>
/// json字符串转Dictionary
/// </summary>
/// <param name="json"></param>
/// <returns></returns>
public static Dictionary<string, object> getValue(string json)
{
//解析json对象
JavaScriptSerializer serializer = new JavaScriptSerializer();
return (Dictionary<string, object>)serializer.DeserializeObject(json);
}

object url;
获取json其中一个值:getValue(payJson).TryGetValue("字段名", out url).ToString()

上一篇:itextsharp图片生成pdf模糊问题解释


下一篇:pip安装显示 is not a supported wheel on this platform.