0
我已經看到了相當多的問題,並嘗試了一些建議的解決方案,但似乎無法解決這個問題。我試圖將JSON轉換爲C#中的對象。有問題的JSON有一個不尋常的(對我來說)佈局,包含一個嵌套的JSON和一個單獨的數組。任何意見將不勝感激。我粘貼了下面兩個JSON的記錄。我的努力包括創建一個匹配JSON佈局並試圖反序列化到這個類中的類。我可以提供有用的代碼。將json與嵌套的json轉換爲c#中的對象?
JSON:
[ [ { "eid" : "113580662029802",
"eids" : [ 113580662029802 ],
"event_date" : "Thursday, April 28th, 2011",
"event_id" : "2476353",
"event_notes" : "",
"event_time" : "8:00 pm",
"event_time_8601" : "2011-04-28T20:00:00-04:00",
"event_timestamp" : 1304035200,
"event_title" : "Colin Hay",
"facebook_event_url" : "http://www.facebook.com/event.php?eid=113580662029802",
"lat" : "42.2793",
"links" : [ { "link_title" : "8:00 pm",
"link_type" : "ticket",
"link_url" : "http://tickets.sonicliving.com/event/2476353/sl-tickets"
} ],
"lon" : "-83.7486",
"poster_url_large" : "http://posters.sonicliving.com/event/2476353/poster.png",
"poster_url_small" : "http://posters.sonicliving.com/event/2476353/smallposter.png",
"rsvp" : "1",
"venue_address" : "316 S. Main St.",
"venue_city" : "Ann Arbor",
"venue_country" : "US",
"venue_id" : "3919",
"venue_name" : "The Ark",
"venue_phone" : "(800) 745-3000",
"venue_state" : "MI"
} ],
[ { "eid" : "199014973442276",
"eids" : [ 199014973442276 ],
"event_date" : "Wednesday, April 13th, 2011",
"event_id" : "2801497",
"event_notes" : "",
"event_time" : "8:00 pm",
"event_time_8601" : "2011-04-13T20:00:00-04:00",
"event_timestamp" : 1302739200,
"event_title" : "Tobacco/Beans/SHAPERS",
"facebook_event_url" : "http://www.facebook.com/event.php?eid=199014973442276",
"lat" : "42.2804",
"links" : [ { "link_title" : "8:00 pm",
"link_type" : "details",
"link_url" : "http://sonicliving.com/event/2801497"
} ],
"lon" : "-83.7512",
"poster_url_large" : "http://posters.sonicliving.com/event/2801497/poster.png",
"poster_url_small" : "http://posters.sonicliving.com/event/2801497/smallposter.png",
"rsvp" : "6",
"venue_address" : "208 S 1st St",
"venue_city" : "Ann Arbor",
"venue_country" : "US",
"venue_id" : "29340",
"venue_name" : "Blind Pig",
"venue_phone" : "(734) 996-8555",
"venue_state" : "MI"
} ]
]
那麼你是要求解析的方法,還是隻用C#或兩者的結構? – climbage 2011-03-11 16:53:58
提供c#類和反序列化代碼。我會偷看一下。 – 2011-03-11 16:54:16