[C#]C#读取Json数据

# //先在项目中添加System.Web.Extensions引用
# //using System.Web.Script.Serialization;
# JavaScriptSerializer serializer = new JavaScriptSerializer();
# Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(
#     "{name: &#39;zswang&#39;, forum: &#39;c#&#39;}");
# object value;
# if (json.TryGetValue("name", out value))
#     Console.WriteLine(value); // 输出:zswang
赞(0) 打赏
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏