zoukankan      html  css  js  c++  java
  • json.net 反序列化

     

    string str =“[{"nick":"xizikr","date":"2012-07-01","campaignid":6820402,"adgroupid":109403796,"keywordid":14521166681,"source":1,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"雪纺短袖上衣 夏","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-01","campaignid":6820402,"adgroupid":109403796,"keywordid":14458147193,"source":2,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"白色雪纺衫","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-02","campaignid":6820402,"adgroupid":109403796,"keywordid":14458268959,"source":1,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"泡泡袖雪纺衫","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-02","campaignid":6820402,"adgroupid":109403796,"keywordid":14458147189,"source":2,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"雪纺衫上衣夏装短袖","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-02","campaignid":6820402,"adgroupid":109403796,"keywordid":14521193780,"source":2,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"雪纺衬衫","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-02","campaignid":6820402,"adgroupid":109403796,"keywordid":13498856537,"source":1,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"荷叶边 雪纺上衣","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-02","campaignid":6820402,"adgroupid":109403796,"keywordid":14521166681,"source":1,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"雪纺短袖上衣 夏","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-03","campaignid":6820402,"adgroupid":109403796,"keywordid":14458147189,"source":2,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"雪纺衫上衣夏装短袖","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-03","campaignid":6820402,"adgroupid":109403796,"keywordid":14458019365,"source":2,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"白色雪纺t恤","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-03","campaignid":6820402,"adgroupid":109403796,"keywordid":14458226918,"source":1,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"上衣 女 夏","searchtype":"SEARCH"},{"nick":"xizikr","date":"2012-07-03","campaignid":6820402,"adgroupid":109403796,"keywordid":14458174238,"source":1,"directpay":0,"indirectpay":0,"directpaycount":0,"indirectpaycount":0,"favitemcount":0,"favshopcount":0,"keywordstr":"雪纺短袖上衣","searchtype":"SEARCH"}]”;
    List<keywordeffec> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<keywordeffec>>(str);
               
                foreach (keywordeffec item in list)
                {
                    Response.Write(item.keywordstr+"<br/>");
                }
    
    public class keywordeffec
    {
        public string nick { get; set; }
        public long campaignid { get; set; }
        public long adgroupid { get; set; }
        public string keywordid { get; set; }
        public string source { get; set; }
        public string indirectpay { get; set; }
        public string directpaycount { get; set; }
        public string indirectpaycount { get; set; }
        public string favitemcount { get; set; }
        public string favshopcount { get; set; }
        public string keywordstr { get; set; }
        public string searchtype { get; set; }
    }
    

     

    转自: http://www.cnblogs.com/tianzhenlanglang/archive/2012/07/04/2576071.html

     

  • 相关阅读:
    Execl获取真实行数
    日期工具类
    Eclipse & IDEA快捷键对比大全
    【转】IDEA导入Eclipse项目 详细步骤(亲自验证导入成功)
    京东的四大集团
    马云演讲视频
    阿里系的一些重要网站
    阿里系的几个电商网站
    腾讯几款QQ软件
    电脑版微信使用说明
  • 原文地址:https://www.cnblogs.com/blosaa/p/2871110.html
Copyright © 2011-2022 走看看