解决方案 »

  1.   

    你的 Customer 中定义的 successed 去哪儿了?
      

  2.   

    楼主的JSON数据错误,数组data少了一个 ] ,否则可以试试fastCSharp
            public class Customer
            {
                public bool successed { get; set; }
                public hotvalue value { get; set; }
            }
            public class hotvalue
            {
                public hotdata[] data { get; set; }
                public int total { get; set; }
            }
            public class hotdata
            {
                public string company_cnt { get; set; }
                public string keywords { get; set; }
                public string showwin_cnt { get; set; }
                public string srh_pv_last_10mon { get; set; }
                public string srh_pv_last_11mon { get; set; }
                public string srh_pv_last_1mon { get; set; }
                public string srh_pv_last_2mon { get; set; }
                public string srh_pv_last_3mon { get; set; }
                public string srh_pv_last_4mon { get; set; }
                public string srh_pv_last_5mon { get; set; }
                public string srh_pv_last_6mon { get; set; }
                public string srh_pv_last_7mon { get; set; }
                public string srh_pv_last_8mon { get; set; }
                public string srh_pv_last_9mon { get; set; }
                public string srh_pv_this_mon { get; set; }
            }            string json = @"{""successed"":true,""value"":{""data"":[{""company_cnt"":""1143"",""keywords"":""kitchen cabinet"",""showwin_cnt"":""298"",""srh_pv_last_10mon"":""13000"",""srh_pv_last_11mon"":""13000"",""srh_pv_last_1mon"":""17000"",""srh_pv_last_2mon"":""16000"",""srh_pv_last_3mon"":""17000"",""srh_pv_last_4mon"":""14000"",""srh_pv_last_5mon"":""16000"",""srh_pv_last_6mon"":""13000"",""srh_pv_last_7mon"":""14000"",""srh_pv_last_8mon"":""18000"",""srh_pv_last_9mon"":""12000"",""srh_pv_this_mon"":""27000"",""yyyymm"":""201408""},{""company_cnt"":""2228"",""keywords"":""cabinet"",""showwin_cnt"":""251"",""srh_pv_last_10mon"":""4200"",""srh_pv_last_11mon"":""6000"",""srh_pv_last_1mon"":""12000"",""srh_pv_last_2mon"":""6000"",""srh_pv_last_3mon"":""4800"",""srh_pv_last_4mon"":""3100"",""srh_pv_last_5mon"":""4100"",""srh_pv_last_6mon"":""2400"",""srh_pv_last_7mon"":""3200"",""srh_pv_last_8mon"":""3300"",""srh_pv_last_9mon"":""3900"",""srh_pv_this_mon"":""13000"",""yyyymm"":""201408""}],""total"":1814}}";
                Customer value = fastCSharp.setup.cSharp.json.parse.Get<Customer>(json);
      

  3.   


    我只是用result代替了success这个名字而已?
      

  4.   


    对的,是我复制少了一个“]”,难道用DataContractJsonSerializer就不能解析这个json吗?
      

  5.   

    {"successed":true,"value":{"data":[{"company_cnt":"1143","keywords":"kitchen cabinet","showwin_cnt":"298","srh_pv_last_10mon":"13000","srh_pv_last_11mon":"13000","srh_pv_last_1mon":"17000","srh_pv_last_2mon":"16000","srh_pv_last_3mon":"17000","srh_pv_last_4mon":"14000","srh_pv_last_5mon":"16000","srh_pv_last_6mon":"13000","srh_pv_last_7mon":"14000","srh_pv_last_8mon":"18000","srh_pv_last_9mon":"12000","srh_pv_this_mon":"27000","yyyymm":"201408"},{"company_cnt":"2228","keywords":"cabinet","showwin_cnt":"251","srh_pv_last_10mon":"4200","srh_pv_last_11mon":"6000","srh_pv_last_1mon":"12000","srh_pv_last_2mon":"6000","srh_pv_last_3mon":"4800","srh_pv_last_4mon":"3100","srh_pv_last_5mon":"4100","srh_pv_last_6mon":"2400","srh_pv_last_7mon":"3200","srh_pv_last_8mon":"3300","srh_pv_last_9mon":"3900","srh_pv_this_mon":"13000","yyyymm":"201408"}],"total":1814}}
      

  6.   

    你发送的时候是bool successed,接收的时候是public string result
    两边的 public class Customer结构都不同,还想反序列化??