0

非常に難しいjson文字列を解析するのに大きな問題があります。例えば

{
    "facilityDetails": [
        {
            "tableName": "FACILITY",
            "facilityDetails": [
                {
                    "id": 1,
                    "itemId": "s101",
                    "name": "facility",
                    "status": 1,
                    "lastEditedOn": "01/Jan/201200: 00: 00.000"
                }
            ]
        },
        {
            "tableName": "PLACE_SERVICE",
            "facilityDetails": [
                {
                    "id": 1,
                    "itemId": "22",
                    "name": "placeservice",
                    "facility": "5",
                    "status": 1,
                    "lastEditedOn": "01/Jan/201000: 00: 00.000"
                },
                {
                    "id": 2,
                    "itemId": "55",
                    "name": "placeservice",
                    "facility": "t",
                    "status": 2,
                    "lastEditedOn": "01/Jan/201000: 00: 00.000"
                },
                {
                    "id": 3,
                    "itemId": "99",
                    "name": "placeservice",
                    "facility": "r",
                    "status": 33,
                    "lastEditedOn": "01/Jan/201000: 00: 00.000"
                },
                {
                    "id": 4,
                    "itemId": "22",
                    "name": "placeservice",
                    "facility": "",
                    "status": 0,
                    "lastEditedOn": "01/Jan/201000: 00: 00.000"
                }
            ]
        },
        {
            "tableName": "AGENT",
            "facilityDetails": [
                {
                    "agentId": 2,
                    "itemId": "1",
                    "name": "agent",
                    "defUnitId": 0,
                    "defRouteId": 0,
                    "color": "",
                    "synonyms": "",
                    "administrationType": 0,
                    "status": 0,
                    "lastEditedOn": "01/Jan/201200: 00: 00.000"
                }
            ]
        }
    ]
}

この json 文字列の "facilityDetails" は、毎回異なる詳細を持つ内部配列です。このタイプのjsonを解析するにはどうすればよいですか。誰かが知っているなら、私を助けてください

4

1 に答える 1

0

これは Json.NET ライブラリで解析できるはずです。

http://james.newtonking.com/projects/json-net.aspx

于 2012-05-21T05:00:30.453 に答える