• 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

     

  • 相关阅读:
    linux系统中输入输出重定向 0<、<、1>、>、2>、1>>、>>、2>>、&>、>&、&>>、2>&1、<<
    linux系统统计某一行出现特定字符的次数
    linux系统中常用的通配符*、?、[ ]、[^xxx]、{}
    R语言strsplit函数用法
    linux系统统计某一字符出现的次数
    什么时候你需要一个虚构函数是虚的
    strcpy的返回值有什么用?
    boost.array 使用实例
    《DB 查询分析器》使用技巧之(七)
    《微型电脑应用》2011年第11期刊登出《万能数据库查询分析器中的事务管理在Oracle中的应用》
  • 原文地址:https://www.cnblogs.com/blosaa/p/2871110.html
Copyright © 2020-2023  润新知