zoukankan      html  css  js  c++  java
  • json 多层序列化

    1. string jsonstr = "{"Code":1,"Message":[{"merchant_id":8,"items":[{"count":2,"goods_name":"商品1  汉堡包22222","goods_des":"汉堡包的描述  有什么好描述的","goods_type":1,"price":19.80,"remark":"20元起送","send_range":"周边一公里","goods_id":2,"create_time":"2014-11-30 13:24:00","update_time":"2014-11-30 13:24:00","status":1,"user_name":"test123"},{"count":2,"goods_name":"商品1  汉堡包","goods_des":"汉堡包的描述  有什么好描述的","goods_type":1,"price":19.80,"remark":"20元起送","send_range":"周边一公里","goods_id":1,"create_time":"2014-11-30 13:24:43","update_time":"2014-11-30 13:24:43","status":1,"user_name":"test123"}]}]}";  
    2.             JObject jo = (JObject)JsonConvert.DeserializeObject(jsonstr);  
    3.             Response.Write(jo["Code"].ToString());  
    4.             JArray jarry = JArray.Parse(jo["Message"].ToString());  
    5.             for (var i = 0; i < jarry.Count; i++)  
    6.             {  
    7.                 JObject j = JObject.Parse(jarry[i].ToString());  
    8.                 Response.Write(j["merchant_id"].ToString());  
    9.                 JArray jarry1 = JArray.Parse(j["items"].ToString());  
    10.                 for (var k = 0; k < jarry1.Count; k++)  
    11.                 {  
    12.                     JObject jk = JObject.Parse(jarry1[k].ToString());  
    13.                     Response.Write(jk["goods_name"].ToString());  
    14.                     Response.Write(jk["remark"].ToString());  
    15.                 }  
    16.             }
  • 相关阅读:
    C/S 架构和B/S架构的区别
    LoadRunner工作原理
    修改密码测试用例
    登录测试用例
    上传测试点
    avd 配置信息详解
    创建模拟器
    命令模式下启动模拟器,加载软件
    启动模拟器时出现Failed to create Context 0x3005
    SDK Manager更新时出现Failed to fectch URl https://dl-ssl.google.com/android/repository/addons_list.xml, reason: Connection to https://dl-ssl.google.com ref
  • 原文地址:https://www.cnblogs.com/zcm123/p/6692429.html
Copyright © 2011-2022 走看看