在vb.net中反序列化并访问CS:GO JSON数组

时间:2015-03-03 15:01:46

标签: arrays json vb.net deserialization json-deserialization

一些非常棒的家伙推出了CS:GO将数据外包为JSON。

http://api.ncla.me/data/data.json

但我真的很难将其反序列化并访问单个项目。 你能帮忙吗?没有第三方添加可能吗? (我不在乎它有多快或多慢。)

这是我走了多远

Public Class RootObject

    Public Property ResultList_Main As List(Of ListWrapper_Main)

    Public Class ListWrapper_Main
        Public Property WeaponInfo As List(Of ListWrapper)
    End Class

    Public Class ListWrapper
        Public Property value As String
        Public Property quantity As String
    End Class
End Class


    jsonObject = jsSerializer.Deserialize(Of RootObject)(responseFromServer)

    For Each Itemdetail1 In jsonObject.ResultList_Main
        For Each Itemdetail2 In Itemdetail1.WeaponInfo
            'Would like to display WeaponInfo + Value + Quantity here
        Next
    Next

0 个答案:

没有答案