0

我正在尝试使用带有 ASP Xtreme Evolution JSON Parser https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp的经典 ASP 解析来自 Twitter 的返回

为简单起见,这里有一个修剪过的 JSON 返回:

[{
    "user": {
    "id": 19720970
    }
}, {
    "user": {
    "id": 201195798
    }
}, {
    "user": {
    "id": 19768935
    }
}]

我需要做的是遍历每个user以发现id. 到目前为止我得到的最好的只返回最后一个id

dim Info : set Info = JSON.parse(join(array(jsonResponse)))
dim key : For Each key in Info.user.keys()
    Response.Write Info.user.id & "<br>" 'only 19768935 is printed
Next
set Info = nothing

有没有人有任何想法如何退休id

第二个查询(但不那么紧急)是,如果我删除了外围方括号,我只能解析它。为什么会这样,有没有办法用它们来解析它?

非常感谢贾斯汀

4

1 回答 1

3

感谢所有关注这个问题的人。

在尝试了很多事情(包括即时重新格式化响应)之后,我找到了解决我问题的相当简单的答案:

For Each key in Info.keys()
    Response.Write Info.get(key).user.id & "<br />"
Next

希望对将来的任何人有所帮助:-)

于 2013-01-10T15:49:26.317 回答