【发布时间】:2016-08-14 17:52:38
【问题描述】:
首先,如果这已经发布,我们深表歉意。我花了一些时间研究,但没有找到解决方案。
我的目标是访问来自 vb.net 中对 Web 请求的各种 JSON 响应的数据。我在嵌套响应时遇到问题;一个例子:
Dim JSON as string = '{"url2": {"href": "https://example.com/test2/"}}'
我有这样的课程:
Public Class test1
Public Class url2
Public href As String
End Class
End Class
反序列化 JSON:
Dim objURL1 As test1 = Newtonsoft.Json.JsonConvert.DeserializeObject(Of test1)(JSON)
这似乎工作正常,但我根本不知道如何访问href 值,在本例中为“https://example.com/test2/”。
【问题讨论】: