There are many similar articles on the Internet, but they only parsed the first layer. It took me a long time to test the rest of it. I will paste my code below and explain it. It can also be considered as a backup of what I have done.
This is the first article I have written. In fact, there are many similar articles on the Internet. I also followed the online articles for experiments at the beginning.
But the json in his article is quite simple. I only parsed the first layer according to his method, and it took me a long time to test it out. I am still not very familiar with the data in json format, and I am not familiar with asp. . Paste my code below and explain it, which also serves as a backup of what I have done.
My json data is obtained from the http interface:
Copy the code code as follows:
{"data":{"0":{"Productinfo":{"id":"8","project_id":"111"}},"info":"22222","mac_status":1}," code":200,"message":"ok"}
The code I quoted from the website can only prompt parsing to the first layer. I had no direction at first about the rest. I tried randomly but couldn't figure it out. Finally I understood the key to json. I just uploaded the code and hoped that others would remind me.
I won’t cut out the previous code and just post the most important part.
dim objtest
CallInitScriptControl
Set objtest = getJSONObject(status)
dim productinfo
getJSArrayItem productinfo, objtest.data, 0
It’s just that I didn’t know how to get the data in the data item before.
Now that I know it, I hope it can help others.