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"] + "
    ";
                }
    

      

  • 相关阅读:
    poj3718 Facer's Chocolate Dream
    codeforces 917D Stranger Trees
    uoj#349 【WC2018】即时战略
    bzoj5153 [Wc2018]州区划分
    bzoj5152 [Wc2018]通道
    loj2001[SDOI2017]树点染色
    loj2000[SDOI2017]数字表格
    Atcoder arc092
    bzoj4826[hnoi2017]影魔
    bzoj4827 [hnoi2017]礼物
  • 原文地址:https://www.cnblogs.com/icejd/p/3885252.html
Copyright © 2011-2022 走看看