0
我目前正在試圖將一些JSONVB.Net JavaScriptSerializer只得到JSON數組的第一個值
{"payload":{"versions":[{"1.0.2":{"vnum":"1.0.2","vloc":"http:\/\/*domainomitted*\/flyswatter\/files\/flyswatter_102.zip"},"1.0.1":{"vnum":"1.0.1","vloc":"http:\/\/*domainomitted*\/flyswatter\/files\/flyswatter_101.zip"}}]}}
進入在VB.Net這裏,Iteratorable對象是我的時刻,但它只返回從JSON數組第一個元素:
Dim vNum() As Object = j.getCfg("versions", False)
'Data is sent as versions:["1.0.1":{"vnum": "1.0.1", "vloc": "http://..."}, "1.0.2":{...}]
log("Populating:")
cbVSel.Items.Clear()
MessageBox.Show(vNum.Length) 'Returns 1
For Each ver As Dictionary(Of String, Object) In vNum
Dim k As String = ver.Keys(0)
MessageBox.Show(k.ToString()) 'Returns 1.0.2
Next
我覺得它的簡單,但我一直在致力於這一段時間。我也嘗試了不同的對象,如HashTable,Array,Dictionary。
所以簡而言之。我怎樣才能得到這個工作;使用JSON數組中的所有版本填充vNum
如果您需要查看JSON解析代碼,請通知我。很感謝任何形式的幫助。
謝謝!