要解析的json

//解析前

//解析前
{"orderlist":[{"backPrice":,"businessId":,"businessNotes":"","couponNo":"","createTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"customerId":,"customerNickname":"","customerRemark":"","dealerType":"","delFlag":"","distTrue":"","duShuPrice":"","evaluateFlag":"","expressDate":"","expressPrice":,"fhPrice":"","getGoodsTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"goodslist":[],"invoiceContent":"","invoiceTitle":"","invoiceType":"","orderCancelRemark":"","orderCancelTime":null,"orderCode":"","orderId":,"orderIntegral":,"orderOldCode":"","orderOldPrice":,"orderPrePrice":,"orderPrePriceOrder":,"orderPrice":,"orderRemark":"","orderStatus":"","payId":,"payTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"sendExpressTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"shippingAddress":"山西路43号省地税直属局","shippingCity":"南京","shippingCounty":"鼓楼区","shippingMobile":"","shippingPerson":"李玲","shippingPhone":"","shippingPostcode":"","shippingProvince":"江苏","shoppingAddrId":,"unionPrice":"0.00","vipPrice":"321.00"},{"backPrice":,"businessId":,"businessNotes":"","couponNo":"","createTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"customerId":,"customerNickname":"","customerRemark":"","dealerType":"","delFlag":"","distTrue":"","duShuPrice":"199.20","evaluateFlag":"","expressDate":"","expressPrice":,"fhPrice":"","getGoodsTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"goodslist":[],"invoiceContent":"","invoiceTitle":"","invoiceType":"","orderCancelRemark":"","orderCancelTime":null,"orderCode":"","orderId":,"orderIntegral":,"orderOldCode":"","orderOldPrice":199.2,"orderPrePrice":,"orderPrePriceOrder":,"orderPrice":199.2,"orderRemark":"","orderStatus":"","payId":,"payTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"sendExpressTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"shippingAddress":"草场门大街88号江苏建设大厦2楼计划财务处","shippingCity":"南京","shippingCounty":"鼓楼区","shippingMobile":"","shippingPerson":"陈明伟","shippingPhone":"","shippingPostcode":"","shippingProvince":"江苏","shoppingAddrId":,"unionPrice":"0.00","vipPrice":""},{"backPrice":,"businessId":,"businessNotes":"","couponNo":"","createTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"customerId":,"customerNickname":"","customerRemark":"","dealerType":"","delFlag":"","distTrue":"","duShuPrice":"","evaluateFlag":"","expressDate":"","expressPrice":,"fhPrice":"","getGoodsTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"goodslist":[],"invoiceContent":"","invoiceTitle":"","invoiceType":"","orderCancelRemark":"","orderCancelTime":null,"orderCode":"","orderId":,"orderIntegral":,"orderOldCode":"","orderOldPrice":,"orderPrePrice":,"orderPrePriceOrder":,"orderPrice":,"orderRemark":"","orderStatus":"","payId":,"payTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"sendExpressTime":{"date":,"day":,"hours":,"minutes":,"month":,"seconds":,"time":,"timezoneOffset":-,"year":},"shippingAddress":"亭湖区黄海中路1号翰香花园1号楼705室13851180736","shippingCity":"盐城","shippingCounty":"盐城市","shippingMobile":"","shippingPerson":"仇玉海。晏泉","shippingPhone":"","shippingPostcode":"","shippingProvince":"江苏","shoppingAddrId":,"unionPrice":"0.00","vipPrice":"214.00"}],"status":"A001"}

个人用来记忆的,高手勿喷

1,开始解析

//ret表示要解析的json
var t = Newtonsoft.Json.JsonConvert.DeserializeObject(ret).ToString();

2,解析后

{
"orderlist": [
{
"backPrice": ,
"businessId": ,
"businessNotes": "",
"couponNo": "",
"createTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"customerId": ,
"customerNickname": "",
"customerRemark": "",
"dealerType": "",
"delFlag": "",
"distTrue": "",
"duShuPrice": "",
"evaluateFlag": "",
"expressDate": "",
"expressPrice": ,
"fhPrice": "",
"getGoodsTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"goodslist": [],
"invoiceContent": "",
"invoiceTitle": "",
"invoiceType": "",
"orderCancelRemark": "",
"orderCancelTime": null,
"orderCode": "",
"orderId": ,
"orderIntegral": ,
"orderOldCode": "",
"orderOldPrice": ,
"orderPrePrice": ,
"orderPrePriceOrder": ,
"orderPrice": ,
"orderRemark": "",
"orderStatus": "",
"payId": ,
"payTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"sendExpressTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"shippingAddress": "山西路43号省地税直属局",
"shippingCity": "南京",
"shippingCounty": "鼓楼区",
"shippingMobile": "",
"shippingPerson": "李玲",
"shippingPhone": "",
"shippingPostcode": "",
"shippingProvince": "江苏",
"shoppingAddrId": ,
"unionPrice": "0.00",
"vipPrice": "321.00"
},
{
"backPrice": ,
"businessId": ,
"businessNotes": "",
"couponNo": "",
"createTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"customerId": ,
"customerNickname": "",
"customerRemark": "",
"dealerType": "",
"delFlag": "",
"distTrue": "",
"duShuPrice": "199.20",
"evaluateFlag": "",
"expressDate": "",
"expressPrice": ,
"fhPrice": "",
"getGoodsTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"goodslist": [],
"invoiceContent": "",
"invoiceTitle": "",
"invoiceType": "",
"orderCancelRemark": "",
"orderCancelTime": null,
"orderCode": "",
"orderId": ,
"orderIntegral": ,
"orderOldCode": "",
"orderOldPrice": 199.2,
"orderPrePrice": ,
"orderPrePriceOrder": ,
"orderPrice": 199.2,
"orderRemark": "",
"orderStatus": "",
"payId": ,
"payTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"sendExpressTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"shippingAddress": "草场门大街88号江苏建设大厦2楼计划财务处",
"shippingCity": "南京",
"shippingCounty": "鼓楼区",
"shippingMobile": "",
"shippingPerson": "陈明伟",
"shippingPhone": "",
"shippingPostcode": "",
"shippingProvince": "江苏",
"shoppingAddrId": ,
"unionPrice": "0.00",
"vipPrice": ""
},
{
"backPrice": ,
"businessId": ,
"businessNotes": "",
"couponNo": "",
"createTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"customerId": ,
"customerNickname": "",
"customerRemark": "",
"dealerType": "",
"delFlag": "",
"distTrue": "",
"duShuPrice": "",
"evaluateFlag": "",
"expressDate": "",
"expressPrice": ,
"fhPrice": "",
"getGoodsTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"goodslist": [],
"invoiceContent": "",
"invoiceTitle": "",
"invoiceType": "",
"orderCancelRemark": "",
"orderCancelTime": null,
"orderCode": "",
"orderId": ,
"orderIntegral": ,
"orderOldCode": "",
"orderOldPrice": ,
"orderPrePrice": ,
"orderPrePriceOrder": ,
"orderPrice": ,
"orderRemark": "",
"orderStatus": "",
"payId": ,
"payTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"sendExpressTime": {
"date": ,
"day": ,
"hours": ,
"minutes": ,
"month": ,
"seconds": ,
"time": ,
"timezoneOffset": -,
"year":
},
"shippingAddress": "亭湖区黄海中路1号翰香花园1号楼705室13851180736",
"shippingCity": "盐城",
"shippingCounty": "盐城市",
"shippingMobile": "",
"shippingPerson": "仇玉海。晏泉",
"shippingPhone": "",
"shippingPostcode": "",
"shippingProvince": "江苏",
"shoppingAddrId": ,
"unionPrice": "0.00",
"vipPrice": "214.00"
}
],
"status": "A001"
}

3,根据解析后的json,用JObject.Parse(t)[]获取对应数据

List<JToken> list = JObject.Parse(t)["orderlist"].ToList();

4,循环list

Newtonsoft.Json.dll解析json的dll文件使用的更多相关文章

  1. Python | JSON 数据解析(Json & JsonPath)

    一.什么是JSON? JSON(JavaScript Object Notation, JS 对象简谱) 是一种轻量级的数据交换格式.它基于 ECMAScript (欧洲计算机协会制定的js规范)的一 ...

  2. JSON.stringify()方法是将一个javascript值(对象或者数组)转换成为一个JSON字符串;JSON.parse()解析JSON字符串,构造由字符串描述的javascript值或对象

    JSON.stringify()方法是将一个javascript值(对象或者数组)转换成为一个JSON字符串:JSON.parse()解析JSON字符串,构造由字符串描述的javascript值或对象

  3. C#使用Json.NET解析Json

    本文转载自 http://xiaosheng.me/2016/10/01/article25/ 最近在 C# 项目中需要使用到 Json 格式的数据,我简单上网搜索了一下,基本上有两种操作 Json ...

  4. Python3基础 json.loads 解析json格式的数据,得到一个字典

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  5. JSON.parse 解析json字符串时,遇换行符报错

    Json字符串转换成Json对象时候,有两种方式: 假设d是json字符串: 1,eval('(' + d + ')'). 2,JSON.parse(d): 但是以上方式有隐患,如果Json字符串有换 ...

  6. Android原生生成JSON与解析JSON

    JSON数据是一种轻量级的数据交换格式,在Android中通常应用于client与server交互之间的传输数据.像如今在网上有非常多解析JSON数据的jar包,可是归根究竟用的都是Android原生 ...

  7. scala解析json —— json4s 解析json方法汇总

    使用json4s的框架,包括spark,flink 1.org.json4s 引入pom的方法 对于本地支持,引入以下依赖项添加到pom中 <dependency> <groupId ...

  8. JSON.parse 解析json字符串时,遇字符串换行符,解析失败

    今天遇到json字符串转对象时报错了,发现有个字符串有换行符,仔细找了原因. 结果是因为JSON.parse转json字符串时遇到一些特殊字符需要先转义,如图所示 然后尝试了各路大神介绍的办法,均不适 ...

  9. Newtonsoft.Json 动态解析 json字符串

    有一个json字符串是动态的,如下面,columns中的数量是不固定的,因此就不能使用反序列化类的方法了: 因此使用这样一种方式,把columns中的所有东西都输出出来: public void Ge ...

随机推荐

  1. 5分钟 搞定UIButton的文本与图片的布局

    UIButton内部文本和图片的布局是我们日常代码中,不可缺少的部分,按钮默认左边图片右边文本,那要实现左边文本,右边图片,我们该怎么解决呢,上面图片,下面文本又该怎么办呢 其实很简单,今天总结下,目 ...

  2. curl常用的5个例子(转)

    我用php ,curl主要是抓取数据,当然我们可以用其他的方法来抓取,比如fsockopen,file_get_contents等.但是只能抓那些能直接访问的页面,如果要抓取有页面访问控制的页面,或者 ...

  3. 深入理解C++中的mutable关键字

      mutalbe的中文意思是“可变的,易变的”,跟constant(既C++中的const)是反义词. 在C++中,mutable也是为了突破const的限制而设置的.被mutable修饰的变量,将 ...

  4. LINUX系统备份

    LINUX系统备份 =========================================================== 作者: gswwgph(http://gswwgph.itp ...

  5. php一些技术要点连接地址

    http基本认证: http://www.php.net/manual/zh/features.http-auth.php

  6. C#_dropdownlist_2

    string deptId =Request.Form["depts"].Trim(); Html.DropDownList()赋默认值: 页面代码如下: <%        ...

  7. Android(java)学习笔记125:Clock app编写报错02

    1.首先之间看错误: 07-13 10:07:55.354: E/AndroidRuntime(8008): FATAL EXCEPTION: main 07-13 10:07:55.354: E/A ...

  8. 【shell】 I/O重定向

    1.基本概念  a.I/O重定向通常与 FD有关,shell的FD通常为10个,即 0-9:  b.常用FD有3个,为0(stdin,标准输入).1(stdout,标准输出).2(stderr,标准错 ...

  9. 关于SWT中的表格(TableViewer类)

    JFace是SWT的扩展.它提供了一组功能强大的界面组件.其中包含表格,树,列表.对话框,向导对话框等. 表格是一种在软件系统中很常用的数据表现形式.特别是基于数据库的应用系统.表格更是不可缺少的界面 ...

  10. windows server 2012R2 网络慢的那些事

    前段时间公司新采购了一台ibm的服务器,装的是 windows server 2012R2, 在做完项目迁移后,发现项目访问数据库缓慢,于是逐项查找原因,最后终于找到解决办法 以Administrat ...