问题描述
{"errorno":0,"total":13,"totalItem":4,"showNum":4,"totalPrice":"2067.00","items":[{"is_cos":false,"is_bigtap":true,"itemId":"2142000015_0_buy","product_id":"1142000023","product_name":"米键蓝色","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T16MZvByWT1RXrhCrK.jpg","num":10,"salePrice":"4.9","noLink":0},{"is_cos":false,"is_bigtap":false,"itemId":"2140100007_0_buy","product_id":"1135000401","product_name":"小米手机3移动版16GB星空灰","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T19RxTB_AT1RXrhCrK.jpg","num":1,"salePrice":"1499","noLink":0},{"is_cos":false,"is_bigtap":false,"itemId":"1143500021_1_buy","product_id":"1143500021","product_name":"MI3配件优惠组合全能套装","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T1cIZ_BX_T1RXrhCrK.jpg","num":1,"salePrice":"220","noLink":0},{"is_cos":false,"is_bigtap":false,"itemId":"2141400001_0_buy","product_id":"1141400001","product_name":"飞利浦无线便携蓝牙音箱黑色","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T14rVTBydT1RXrhCrK.jpg","num":1,"salePrice":"299","noLink":0}]}
解决方案
解决方案二:
{"errorno":0,"total":13,"totalItem":4,"showNum":4,"totalPrice":"2067.00","items":[{"is_cos":false,"is_bigtap":true,"itemId":"2142000015_0_buy","product_id":"1142000023","product_name":"米键蓝色","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T16MZvByWT1RXrhCrK.jpg","num":10,"salePrice":"4.9","noLink":0},{"is_cos":false,"is_bigtap":false,"itemId":"2140100007_0_buy","product_id":"1135000401","product_name":"小米手机3移动版16GB星空灰","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T19RxTB_AT1RXrhCrK.jpg","num":1,"salePrice":"1499","noLink":0},{"is_cos":false,"is_bigtap":false,"itemId":"1143500021_1_buy","product_id":"1143500021","product_name":"MI3配件优惠组合全能套装","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T1cIZ_BX_T1RXrhCrK.jpg","num":1,"salePrice":"220","noLink":0},{"is_cos":false,"is_bigtap":false,"itemId":"2141400001_0_buy","product_id":"1141400001","product_name":"飞利浦无线便携蓝牙音箱黑色","image_url":"http://img08.mifile.cn/v1/MI_18455B3E4DA706226CF7535A58E875F0267/T14rVTBydT1RXrhCrK.jpg","num":1,"salePrice":"299","noLink":0}]}
解决方案三:
数据循环出来的时候安装json格式组装成字符串返回出去就行了
解决方案四:
StringBuilder拼接很麻烦
解决方案五:
stingx=newJavaScriptSerializer().Serialize(new{Results=results,Message=message}
可以直接序列化成JSON格式usingSystem.Web.Script.Serialization;
解决方案六:
引用4楼aa317016589的回复:
stingx=newJavaScriptSerializer().Serialize(new{Results=results,Message=message}可以直接序列化成JSON格式usingSystem.Web.Script.Serialization;
解释解释Results=results,Message=message是什么
解决方案七:
引用5楼zmlzmlzml的回复:
Quote: 引用4楼aa317016589的回复:
stingx=newJavaScriptSerializer().Serialize(new{Results=results,Message=message}可以直接序列化成JSON格式usingSystem.Web.Script.Serialization;
解释解释Results=results,Message=message是什么
匿名类,JSON自定义属性
解决方案八:
把数据丢进去,输出到界面就上知道了