【发布时间】:2016-06-20 03:44:15
【问题描述】:
我有一个 JSON 结果,我正在尝试使用 Newtonsoft.Json 将其转换为数组。 我从网站获得的 JSON 结果类似于(为便于阅读而格式化):
{
"headers":
[
"Shift Date",
"Shift Number"
],
"values":
[
["2016-06-19T00:00:00",0],
["2016-06-19T00:00:00",2],
["2016-06-19T00:00:00",1]
]
}
我发现的代码示例说我应该能够使用
Dim arr As JArray = JArray.Parse(response.Content)
这会导致错误:
An unhandled exception of type 'Newtonsoft.Json.JsonReaderException' occurred in Newtonsoft.Json.dll
Additional information: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1.
有关可能导致问题的任何指导?我怀疑它与“标题”有关,但无法在网上找到有关如何解决的任何建议
【问题讨论】: