{"role":"\u65b0\u624b05580425","level":"3","accountId":"500666114","account":"xiaoshenyang","gold":{"node":{"3":2800}},"status":"0","msg":"\u6210\u529f\u65e0\u4fe1\u606f"}500666114
目前需要读取gold里的node中的2800数据。
我使用以下的代码来解析Json,但无法进一步读取我需要的node的数值。
- Dim scriptCtrl
- Function parseJSON(str)
- If Not IsObject(scriptCtrl) Then
- Set scriptCtrl = Server.CreateObject("MSScriptControl.ScriptControl")
- scriptCtrl.Language = "JScript"
- scriptCtrl.AddCode "function ActiveXObject() {}" ' 覆盖 ActiveXObject
- scriptCtrl.AddCode "function GetObject() {}" ' 覆盖 ActiveXObject
- scriptCtrl.AddCode "Array.prototype.get = function(x) { return this[x]; }; var result = null;"
- End If
- On Error Resume Next
- scriptCtrl.ExecuteStatement "result = " & str & ";"
- Set parseJSON = scriptCtrl.CodeObject.result
- If Err Then
- Err.Clear
- Set parseJSON = Nothing
- End If
- End Function
复制代码
请教各们高手帮助解答一下。
谢谢。 |