我有一個來自Web服務的JSON響應,我需要將其轉換爲對象,然後轉換爲數組。我的回覆類似於下面的那個:將JSON字符串轉換爲JSON對象
{"status":{"error":"NO","code":"200","description":"none","message":"Request ok"},"geolocation":{"lat":"38.89515","lng":"-77.0310"},"stations":[{"country":"United States","regPrice":"0.00","midPrice":"0.00","prePrice":"0.00","streetAddress":"1401, I St NW","ID":"1900","lat":"38.901440","lng":"-77.032127","stationName":"Shell","logo":"http:\/\/www.nyneaxis.com\/logo\/stations\/noLogo.png","state":"District of Columbia","city":"Washington D.C.","regDate":null,"midDate":null,"preDate":null,"distance":"0.7"},{"country":"United States","regPrice":"0.00","midPrice":"0.00","prePrice":"0.00","streetAddress":"2116-2150, M St NW","ID":"13029","lat":"38.905201","lng":"-77.048103","stationName":"Exxon","logo":"http:\/\/www.nyneaxis.com\/logo\/stations\/noLogo.png","state":"District of Columbia","city":"Washington D.C.","regDate":null,"midDate":null,"preDate":null,"distance":"1.9"}]}
我這樣做的是VB.NET內控制檯現在。基本上我試圖創建一個簡單的方法來測試我的API調用並輸出信息。我試圖完成的是不得不循環遍歷JSON數組並列出工作站。我從來沒有在VB.NET中做過這件事,並希望得到一些幫助。我一直在閱讀有關反序列化的內容,但並不瞭解它。
看到這個問題http://stackoverflow.com/questions/1474377/json-library-for-c-sharp – MarkJ 2012-01-18 08:13:43