且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用VB.net和Newtonsoft.Json解析复杂的Json数据

更新时间:2023-01-17 21:15:38

使用类似 https://jsonformatter.curiousconcept的名称.com/以便于查看.

然后简单

Dim Something as JObject = JObject.Parse(<your JSON>)

然后用

Something1 = Something("data")("mdc_cashprices")("data")("data")("instruments")(0)("last") 'basically you just traverse the levels, you use the id/text for regular stuff (inside {}) and numbers for arrays (inside [])

因为它是一个数组,所以您可能要循环它

Since it's an array you would probably want to loop it

For Each item In Something("data")("mdc_cashprices")("data")("data")("instruments")
        Something2 = item("last")
Next

在这里还有一些格式问题>>> mdc_cashprices _ {\要求...<<< _和\不应该在那儿"

Btw there are some formatting issues here >>> mdc_cashprices_{\"req... <<< that _ and \ shouldn't be there"