0

我从Box.com得到这个 JSON :

{
    "total_count": 2,
    "entries": [
        {
            "type": "file",
            "id": "2615240421",
            "sequence_id": "0",
            "name": "successful file upload.png",
            "description": null,
            "size": 19586,
            "path": "/Hey Hey Whats Goin On/successful file upload.png",
            "path_id": "/316877053/2615240421",
            "created_at": "2012-07-11T11:54:21-07:00",
            "modified_at": "2012-07-11T11:54:21-07:00",
            "etag": null,
            "created_by": {
                "type": "user",
                "id": "181757341",
                "name": "sean test",
                "login": "sean+test@box.com"
            },
            "modified_by": {
                "type": "user",
                "id": "181757341",
                "name": "sean test",
                "login": "sean+test@box.com"
            },
            "owned_by": {
                "type": "user",
                "id": "181757341",
                "name": "sean test",
                "login": "sean+test@box.com"
            },
            "shared_link": null,
            "parent": {
                "type": "folder",
                "id": "316877053",
                "sequence_id": "0",
                "name": "Hey Hey Whats Goin On"
            }
        },
        {
            "type": "file",
            "id": "2615240431",
            "sequence_id": "0",
            "name": "a whole lot of shit just happenedjson.png",
            "description": null,
            "size": 128063,
            "path": "/Hey Hey Whats Goin On/a whole lot of shit just happenedjson.png",
            "path_id": "/316877053/2615240431",
            "created_at": "2012-07-11T11:54:21-07:00",
            "modified_at": "2012-07-11T11:54:21-07:00",
            "sha1": null,
            "created_by": {
                "type": "user",
                "id": "181757341",
                "name": "sean test",
                "login": "sean+test@box.com"
            },
            "modified_by": {
                "type": "user",
                "id": "181757341",
                "name": "sean test",
                "login": "sean+test@box.com"
            },
            "owned_by": {
                "type": "user",
                "id": "181757341",
                "name": "sean test",
                "login": "sean+test@box.com"
            },
            "shared_link": null,
            "parent": {
                "type": "folder",
                "id": "316877053",
                "sequence_id": "0",
                "name": "Hey Hey Whats Goin On"
            }
        }
    ]
}

我需要获取每个文件的修改信息。不确定如何在 .NET 中执行此操作。我习惯于解析 XML。我在 Stack 上看过一些例子,但它们通常是浅对象。不确定更深的物体。

帮助?

谢谢

4

1 回答 1

0

我只会使用内置的JavaScriptSerializer 类。您可以将 JSON 反序列化为特定类型或“即时”类型,然后您可以“遍历”。

于 2012-07-25T23:56:49.603 回答