最近项目需要, 搞了一串嵌套非常多的Json 用LitJson读取体验不太好,上网查了一下发现NetwtonsoftJson ,十分好用

  一句代码就可以了

 JObject data = JsonConvert.DeserializeObject<JObject>(message);

  

  其实也可以用LitJson方法

  主要用法是把Json文件 格式化,然后搞清楚层级结构关系,创建一个对应类就可以直接转换了

   APPStore appStore = JsonMapper.ToObject<APPStore>(message);

  需要根据Json结构建好一个类 例如:

  

public class APPStore
{
public List<Category> data { get; set; }
} public class Category
{
public int id { get; set; }
public int pid { get; set; }
public string name { get; set; }
public int special { get; set; }
public List<AppCategory> child { get; set; }
} public class AppCategory
{
public int id { get; set; }
public int pid { get; set; }
public string name { get; set; }
public int special { get; set; }
public List<AppData> child { get; set; }
}

  

最新文章

  1. [CodeWars][JS]实现大整数加法
  2. 如何在Windows 2003+IIS6的环境下找回应用程序池(application pool)中的服务账号密码
  3. 细说 webpack 之流程篇
  4. app 尺寸
  5. tomcat+nginx+redis实现均衡负载、session共享(二)
  6. SVN 在 linux 下的配置
  7. 这两个成员函数inline重新virtual种类
  8. 2-jQuery - AJAX load() 方法【进阶篇】
  9. zookeeper入门系列:概述
  10. 咸鱼Chen
  11. [APIO2017]商旅(floyd+分数规划+SPFA)
  12. exists,in的区别-mysql
  13. [Swift]LeetCode806. 写字符串需要的行数 | Number of Lines To Write String
  14. P1546 最短网络 Agri-Net题解(克鲁斯卡尔)
  15. Angular4 组件间通讯
  16. git 之路
  17. json与csv的基础用与法
  18. php \r\n
  19. java代码示例(6-4)
  20. linux之 redis 的rdb 转 aof 及主从复

热门文章

  1. appium:报错Message: Message: Parameters were incorrect. We wanted {&quot;required&quot;:[&quot;value&quot;]}
  2. fastdfs java客户端操作
  3. python自动化-取消&quot;Chrome正受到自动软件的控制&quot;提示
  4. Dockerfile打包java应用
  5. react项目--路由封装
  6. HIVE- lag函数和lead函数
  7. python脚本打包
  8. TypeScript 学习之路
  9. (已解决)为什么最新版本(v4.3.1)的bootstrap不能使用center-block?
  10. Linux 第八节(防火墙 )