首页 新闻 搜索 专区 学院

下面的JSON如何生成C#类

0
[已解决问题] 解决于 2015-06-29 14:39
{
    "success": true, 
    "resultMessage": "", 
    "resultCode": null, 
    "result": {
        "385620": [
            {
                "id": 4680760, 
                "skuId": 385620, 
                "path": "380/f8f1be5f-4e4e-439b-9fb4-d4ebf2dfb39d.jpg", 
                "created": "2011-07-26 16:54:25", 
                "modified": "2011-07-26 16:54:25", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 0, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4680759, 
                "skuId": 385620, 
                "path": "3150/f96166cb-8686-40fe-b8c7-14c82132940f.jpg", 
                "created": "2011-07-26 16:54:25", 
                "modified": "2011-07-26 16:54:25", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 1, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4680756, 
                "skuId": 385620, 
                "path": "1896/43e31383-d821-4cdf-b487-09df9e557783.jpg", 
                "created": "2011-07-26 16:54:25", 
                "modified": "2011-07-26 16:54:25", 
                "yn": 1, 
                "isPrimary": 1, 
                "orderSort": 2, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4680758, 
                "skuId": 385620, 
                "path": "2872/fe2c8c2c-6fd0-4759-8b56-8c76049949b3.jpg", 
                "created": "2011-07-26 16:54:25", 
                "modified": "2011-07-26 16:54:25", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 3, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4680757, 
                "skuId": 385620, 
                "path": "2593/1b8a7654-7d3f-400f-9d39-d496152db839.jpg", 
                "created": "2011-07-26 16:54:25", 
                "modified": "2011-07-26 16:54:25", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 4, 
                "position": null, 
                "type": null, 
                "features": null
            }
        ], 
        "937433": [
            {
                "id": 4023269, 
                "skuId": 937433, 
                "path": "g13/M08/08/01/rBEhVFIbHb8IAAAAAAFmGihDzWIAACdugO9ws8AAWYy662.jpg", 
                "created": "2013-08-26 17:20:01", 
                "modified": "2014-07-24 19:51:54", 
                "yn": 1, 
                "isPrimary": 1, 
                "orderSort": 0, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4023267, 
                "skuId": 937433, 
                "path": "g13/M08/08/01/rBEhUlIbHb8IAAAAAADxJRUowG4AACdugPFn48AAPE9061.jpg", 
                "created": "2013-08-26 17:20:01", 
                "modified": "2013-08-26 17:20:01", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 1, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4023268, 
                "skuId": 937433, 
                "path": "g13/M08/08/01/rBEhUlIbHcAIAAAAAAHc-V7em8kAACdugPogkcAAd0R400.jpg", 
                "created": "2013-08-26 17:20:01", 
                "modified": "2013-08-26 17:20:01", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 2, 
                "position": null, 
                "type": null, 
                "features": null
            }, 
            {
                "id": 4023266, 
                "skuId": 937433, 
                "path": "g13/M07/08/01/rBEhVFIbHcAIAAAAAAL_uibLmwIAACduwAUxlIAAv_S112.jpg", 
                "created": "2013-08-26 17:20:01", 
                "modified": "2013-08-26 17:20:01", 
                "yn": 1, 
                "isPrimary": 0, 
                "orderSort": 3, 
                "position": null, 
                "type": null, 
                "features": null
            }
        ]
    }
}
新麦穗的主页 新麦穗 | 初学一级 | 园豆:82
提问于:2015-02-28 16:31
< >
分享
最佳答案
0

这两天才在园子看的,给你copy过来:

http://www.cnblogs.com/tianqiq/p/4309791.html

奖励园豆:5
luzemin | 初学一级 |园豆:21 | 2015-03-04 19:22
其他回答(3)
0

创建好对应属性的模型,或者转成Jobject之后用linq to json操作.

Tzn | 园豆:11 (初学一级) | 2015-02-28 17:16

补充:创建好模型后用json.net 转换。

支持(0) 反对(0) Tzn | 园豆:11 (初学一级) | 2015-02-28 17:17
0

  Model _model= new Model ();
  _model= new JavaScriptSerializer().Deserialize<Model>(Json);

贫民窟大侠 | 园豆:4270 (老鸟四级) | 2015-03-04 11:44
0

可以将json直接转换为字典列表,然后按照需要访问。。。

数据之巅 | 园豆:307 (菜鸟二级) | 2015-03-06 21:23
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册