zoukankan      html  css  js  c++  java
  • C# JObject解析Json(多方法解析Json 二)

    下载Newtonsoft.Json,添加引用

    记得using Newtonsoft.Json.Linq;

    //用JObject解析
                string json = "{"offlineLock":{"id":"4028d808581dab0f01581db51405001e","mac":"D4:3D:7E:5F:B7:44","sdsl":5,"sdrq":1477967156304,"shlb":"0"},"flag":"success","status":"1400","resultList":[{"id":"4028d808581dab0f01581db5145c001f","zwjyzsbh":"1000001600000052","sfyfz":"0"},{"id":"4028d808581dab0f01581db514780020","zwjyzsbh":"1000001600000054","sfyfz":"0"},{"id":"4028d808581dab0f01581db514950021","zwjyzsbh":"1000001600000056","sfyfz":"0"},{"id":"4028d808581dab0f01581db514b20022","zwjyzsbh":"1000001600000058","sfyfz":"0"},{"id":"4028d808581dab0f01581db514cc0023","zwjyzsbh":"1000001600000060","sfyfz":"0"}]}";
    
                JObject jo = (JObject)JsonConvert.DeserializeObject(json);
                string id = jo["offlineLock"]["id"].ToString();
                Console.WriteLine(id);
    
                Console.ReadLine();
  • 相关阅读:
    Navicat远程连接服务器Mysql
    JSP与Servlet之间传值
    JSP获取绝对路径
    PIL的库学习
    科学计算与可视化
    预测球类比赛结果
    预测球类比赛结果
    汉诺塔问题
    有进度条圆周率计算
    turtle学习心得
  • 原文地址:https://www.cnblogs.com/Donnnnnn/p/6019543.html
Copyright © 2011-2022 走看看