|
本帖最后由 hai167 于 2018-10-18 18:11 编辑
解析json,试了好多个方法还是提取不了,请高手指点一下,例如我现在要取advice_result对应的值,没有真正理解json结构的解析,有劳高手点开我一下,非常感谢。
json字符串
{
"return_code": "OK",
"result_code": "SUCCESS",
"result": {
"return_code": "OK",
"result_code": "SUCCESS",
"result": {
"rm_code": 0,
"message": "pass",
"body": {
"report": "{\"title\":\"保理企业报告\",\"ent_name\":\"腾讯数码(深圳)有限公司\",\"ent_id\":\"914403007938536006\",\"time\":\"2018-10-18 17:02:08\",\"version\":[{\"autorun\":\"V1.0\",\"time\":\"2018-10-18 17:02:08\"}],\"strategy_1\":{\"block_title\":\"初审决策结果\",\"advice_result\":0,\"id\":\"cus_first_review_verify_6718\",\"children\":[{\"type\":\"ruleset\",\"id\":\"cus_first_review_verify_8538\",\"name\":\"行业禁入\",\"children\":[{\"type\":\"rule\",\"id\":164,\"name\":\"行业禁入\",\"autorun\":{\"risk_result\":\"0\"}}]},{\"type\":\"ruleset\",\"id\":\"cus_first_review_verify_0736\",\"name\":\"其他禁入\",\"children\":[{\"type\":\"rule\",\"id\":165,\"name\":\"成立未满1年\",\"autorun\":{\"risk_result\":\"0\"}},{\"type\":\"rule\",\"id\":166,\"name\":\"外资企业\",\"autorun\":{\"risk_result\":\"0\"}},{\"type\":\"rule\",\"id\":167,\"name\":\"近12个月大股东出现变更\",\"autorun\":{\"risk_result\":\"0\"}},{\"type\":\"rule\",\"id\":168,\"name\":\"近12个月法人代表出现变更\",\"autorun\":{\"risk_result\":\"0\"}}]}]},\"buyer_info\":{\"block_title\":\"买方信息\",\"data\":[]},\"memo\":{\"block_title\":\"备注\",\"text\":\"\"}}"
}
}
}
网上方法1
Set x = CreateObject("ScriptControl"): x.Language = "JScript"
Set y = x.eval("eval(" & JSONString & ")")
MsgBox y.Result.Result.body.report.strategy_1.advice_result '报错
网上方法2
Set oDom = CreateObject("htmlfile")
Set oWindow = oDom.parentWindow
oWindow.execScript "var o=" & JSONString
MsgBox oWindow.o.Result.Result.body.report.strategy_1.advice_result '报错
以及怎么循环report里所有的值
json字符串.rar
(657 Bytes, 下载次数: 11)
|
|