0
返回的JSON我在asp.net VB以下JSON:遍歷從API
Dim jsonString As String = "{'results':[ {'comments': 'some text', 'date' : 'some date', 'user':'aaa'},{'comments': 'some text2', 'date2' : 'some date2', 'user':'aaa2'}]} "
Dim json As JObject = JObject.Parse(jsonString)
我怎麼能循環,雖然這樣的評論的價值?
謝謝
你有什麼嘗試?您是否閱讀過Newtonsoft文檔頁面[使用LINQ查詢JSON](http://www.newtonsoft.com/json/help/html/QueryingLINQtoJSON.htm)和[使用SelectToken查詢JSON](http://www.newtonsoft。 COM/JSON /幫助/ HTML/SelectToken.htm)? – dbc
我其實已經想通了。但是這隻適用於框架4.0或更高版本。 – user3570022
Dim jsonString As String =「{'results':[{'comments':'some text','date':'some date','user':'aaa'},{'comments':'some text2' , 'DATE2': '一些DATE2', '用戶': 'aaa2'}]}「 昏暗JSON作爲JObject = JObject.Parse(jsonString) 昏暗commToken作爲JToken 昏暗commValue作爲字符串 對於每行中的JSON (「results」)ToList() commToken = Row(「comments」) commValue = DirectCast(commToken,JValue).Value Next – user3570022