zoukankan      html  css  js  c++  java
  • c#读取快递100查询返回的JSON信息

    {"message":"ok","nu":"1105016801203","companytype":"ems","ischeck":"1","com":"ems","updatetime":"2014-08-01 10:17:31","status":"200","condition":"F00","codenumber":"1105016801203","data":[{"time":"2014-07-30 16:47:00","location":"","context":"赤峰市邮政速递物流分公司新华路揽投部 妥投 本人收签收","ftime":"2014-07-30 16:47:00"},{"time":"2014-07-30 15:18:00","location":"","context":"赤峰市邮政速递物流分公司新华路揽投部 安排投递","ftime":"2014-07-30 15:18:00"},{"time":"2014-07-30 15:09:30","location":"","context":"赤峰市邮政速递物流分公司新华路揽投部 到达处理中心,来自赤峰市","ftime":"2014-07-30 15:09:30"},{"time":"2014-07-30 12:03:42","location":"","context":"赤峰市 离开处理中心,发往赤峰市邮政速递物流分公司新华路揽投部","ftime":"2014-07-30 12:03:42"},{"time":"2014-07-30 11:23:49","location":"","context":"赤峰市 到达处理中心,来自上海市","ftime":"2014-07-30 11:23:49"},{"time":"2014-07-27 23:37:00","location":"","context":"上海市 离开处理中心,发往赤峰市","ftime":"2014-07-27 23:37:00"},{"time":"2014-07-27 15:46:16","location":"","context":"上海市邮政速递物流有限公司北临空揽投部 离开处理中心,发往上海市","ftime":"2014-07-27 15:46:16"},{"time":"2014-07-27 14:27:00","location":"","context":"上海市邮政速递物流有限公司北临空揽投部 收寄","ftime":"2014-07-27 14:27:00"}],"state":"3"}

    using Newtonsoft.Json;
    using Newtonsoft.Json.Linq;

                JObject jos = (JObject)JsonConvert.DeserializeObject(textBox1.Text);
                string str = jos["data"].ToString();
                JArray ja = (JArray)JsonConvert.DeserializeObject(str);
                foreach (JObject o in ja)
                {
                    textBox2.Text += o["context"] + "
    ";
                }
    

      

  • 相关阅读:
    【pandas实战】时间差计算
    【pandas实战】数据分类整理
    海量数据处理方法整理记录
    Springboot中实现策略模式+工厂模式
    实现一个秒杀系统
    Redis实现的分布式锁和分布式限流
    实现分布式服务注册及简易的netty聊天
    聊聊数据库乐观锁和悲观锁,乐观锁失败后重试
    聊聊RPC原理二
    聊聊kafka结构
  • 原文地址:https://www.cnblogs.com/icejd/p/3885252.html
Copyright © 2011-2022 走看看