Newtonsoft.Json.dll解析json的dll文件使用
2015-03-03 18:41
645 查看
要解析的json
//解析前
View Code
3,根据解析后的json,用JObject.Parse(t)[]获取对应数据
4,循环list
//解析前
{ "orderlist": [ { "backPrice": 0, "businessId": 93, "businessNotes": "", "couponNo": "", "createTime": { "date": 9, "day": 1, "hours": 15, "minutes": 35, "month": 1, "seconds": 8, "time": 1423467308000, "timezoneOffset": -480, "year": 115 }, "customerId": 167193, "customerNickname": "", "customerRemark": "", "dealerType": "", "delFlag": "0", "distTrue": "", "duShuPrice": "", "evaluateFlag": "", "expressDate": "", "expressPrice": 11, "fhPrice": "", "getGoodsTime": { "date": 17, "day": 2, "hours": 22, "minutes": 55, "month": 1, "seconds": 45, "time": 1424184945000, "timezoneOffset": -480, "year": 115 }, "goodslist": [], "invoiceContent": "", "invoiceTitle": "", "invoiceType": "0", "orderCancelRemark": "", "orderCancelTime": null, "orderCode": "201502091535081953", "orderId": 2724, "orderIntegral": 0, "orderOldCode": "", "orderOldPrice": 321, "orderPrePrice": 0, "orderPrePriceOrder": 0, "orderPrice": 321, "orderRemark": "", "orderStatus": "3", "payId": 1, "payTime": { "date": 9, "day": 1, "hours": 15, "minutes": 32, "month": 1, "seconds": 23, "time": 1423467143000, "timezoneOffset": -480, "year": 115 }, "sendExpressTime": { "date": 10, "day": 2, "hours": 13, "minutes": 30, "month": 1, "seconds": 37, "time": 1423546237000, "timezoneOffset": -480, "year": 115 }, "shippingAddress": "山西路43号省地税直属局", "shippingCity": "南京", "shippingCounty": "鼓楼区", "shippingMobile": "15150512058", "shippingPerson": "李玲", "shippingPhone": "83633592", "shippingPostcode": "210009", "shippingProvince": "江苏", "shoppingAddrId": 1067, "unionPrice": "0.00", "vipPrice": "321.00" }, { "backPrice": 0, "businessId": 87, "businessNotes": "", "couponNo": "", "createTime": { "date": 9, "day": 1, "hours": 11, "minutes": 26, "month": 1, "seconds": 33, "time": 1423452393000, "timezoneOffset": -480, "year": 115 }, "customerId": 167782, "customerNickname": "", "customerRemark": "", "dealerType": "", "delFlag": "0", "distTrue": "", "duShuPrice": "199.20", "evaluateFlag": "", "expressDate": "", "expressPrice": 0, "fhPrice": "", "getGoodsTime": { "date": 19, "day": 4, "hours": 22, "minutes": 55, "month": 1, "seconds": 42, "time": 1424357742000, "timezoneOffset": -480, "year": 115 }, "goodslist": [], "invoiceContent": "", "invoiceTitle": "", "invoiceType": "0", "orderCancelRemark": "", "orderCancelTime": null, "orderCode": "201502091126333935", "orderId": 2719, "orderIntegral": 0, "orderOldCode": "", "orderOldPrice": 199.2, "orderPrePrice": 0, "orderPrePriceOrder": 0, "orderPrice": 199.2, "orderRemark": "", "orderStatus": "3", "payId": 1, "payTime": { "date": 11, "day": 3, "hours": 11, "minutes": 17, "month": 1, "seconds": 19, "time": 1423624639000, "timezoneOffset": -480, "year": 115 }, "sendExpressTime": { "date": 12, "day": 4, "hours": 11, "minutes": 24, "month": 1, "seconds": 47, "time": 1423711487000, "timezoneOffset": -480, "year": 115 }, "shippingAddress": "草场门大街88号江苏建设大厦2楼计划财务处", "shippingCity": "南京", "shippingCounty": "鼓楼区", "shippingMobile": "18205088909", "shippingPerson": "陈明伟", "shippingPhone": "", "shippingPostcode": "", "shippingProvince": "江苏", "shoppingAddrId": 1130, "unionPrice": "0.00", "vipPrice": "" }, { "backPrice": 0, "businessId": 93, "businessNotes": "", "couponNo": "", "createTime": { "date": 9, "day": 1, "hours": 11, "minutes": 11, "month": 1, "seconds": 25, "time": 1423451485000, "timezoneOffset": -480, "year": 115 }, "customerId": 165780, "customerNickname": "", "customerRemark": "", "dealerType": "", "delFlag": "0", "distTrue": "", "duShuPrice": "", "evaluateFlag": "", "expressDate": "", "expressPrice": 8, "fhPrice": "", "getGoodsTime": { "date": 17, "day": 2, "hours": 22, "minutes": 55, "month": 1, "seconds": 45, "time": 1424184945000, "timezoneOffset": -480, "year": 115 }, "goodslist": [], "invoiceContent": "", "invoiceTitle": "", "invoiceType": "0", "orderCancelRemark": "", "orderCancelTime": null, "orderCode": "201502091111253041", "orderId": 2718, "orderIntegral": 0, "orderOldCode": "", "orderOldPrice": 214, "orderPrePrice": 0, "orderPrePriceOrder": 0, "orderPrice": 214, "orderRemark": "", "orderStatus": "3", "payId": 1, "payTime": { "date": 9, "day": 1, "hours": 11, "minutes": 18, "month": 1, "seconds": 18, "time": 1423451898000, "timezoneOffset": -480, "year": 115 }, "sendExpressTime": { "date": 10, "day": 2, "hours": 13, "minutes": 31, "month": 1, "seconds": 16, "time": 1423546276000, "timezoneOffset": -480, "year": 115 }, "shippingAddress": "亭湖区黄海中路1号翰香花园1号楼705室13851180736", "shippingCity": "盐城", "shippingCounty": "盐城市", "shippingMobile": "13851057736", "shippingPerson": "仇玉海。晏泉", "shippingPhone": "", "shippingPostcode": "", "shippingProvince": "江苏", "shoppingAddrId": 1387, "unionPrice": "0.00", "vipPrice": "214.00" } ], "status": "A001" }
View Code
3,根据解析后的json,用JObject.Parse(t)[]获取对应数据
List<JToken> list = JObject.Parse(t)["orderlist"].ToList();
4,循环list
相关文章推荐
- .net使用Newtonsoft.Json.dll解析json过程的几种特殊情况处理
- 使用Newtonsoft.Json.dll(JSON.NET)动态解析JSON、.net 的json的序列化与反序列化(一)
- 使用Newtonsoft.Json.dll(JSON.NET)动态解析JSON、.net 的json的序列化与反序列化(一)
- 使用C++语言来解析json文件
- 使用NewtonSoft.JSON.dll来序列化和发序列化对象
- ASP.NET使用Newtonsoft.Json反解析带子集的JSON字符串
- C# newtonsoft.json.dll 解析Json
- 使用NewtonSoft.JSON.dll来序列化和发序列化对象
- vs2005中使用Newtonsoft.Json.dll操作json
- 使用.NET4.0的dynamic特性解析plist文件及json字符串
- .NET json格式 使用Newtonsoft.Json.JsonConvert类 附读取文件方法
- 使用python解析json文件
- 使用NewtonSoft.JSON.dll来序列化和发序列化对象
- Newtonsoft.Json.dll 使用
- 使用NewtonSoft.JSON.dll来序列化和反序列化对象
- Newtonsoft.Json.dll使用
- 使用NewtonSoft.JSON.dll来序列化和发序列化对象
- .Newtonsoft.Json.dll 使用
- Newtonsoft.Json.dll使用
- Extjs 使用fileText 文件上次后 无法解析后台返回的json问题