|
- {
- "success": true,
- "msg": "ok",
- "code": 0,
- "t": {
- "turnNum": "31/05/2021-1236",
- "openTime": "2021-05-31 22:27:00",
- "serverTime": "2021-05-31 22:26:56",
- "name": "Siêu Tốc 45 Giay",
- "code": "st45g",
- "issueList": [{
- "turnNum": "31/05/2021-1235",
- "openNum": "9,6,6,6,5,5",
- "openTime": "2021-05-31 22:26:15",
- "detail": "["966655","32323","65974","94404,01068","26581,99064,01051,50667,07036,25076,97023","9447","8446,2628,1059","381","67"]"
- }, {
- "turnNum": "31/05/2021-1234",
- "openNum": "8,9,5,9,3,6",
- "openTime": "2021-05-31 22:25:30",
- "detail": "["895936","51965","55936","58515,18551","52382,24847,76418,09611,28779,36644,67726","7194","2465,6783,5233","092","50"]"
- }, {
- "turnNum": "31/05/2021-1233",
- "openNum": "0,4,0,2,7,1",
- "openTime": "2021-05-31 22:24:45",
- "detail": "["040271","64139","11179","94176,70599","84605,44464,43328,68026,99781,49458,08283","8078","4442,1375,9591","284","09"]"
- }, {
- "turnNum": "31/05/2021-1232",
- "openNum": "2,5,0,6,3,9",
- "openTime": "2021-05-31 22:24:00",
- "detail": "["250639","85851","90505","96689,53958","35820,72607,02020,11928,42420,22039,07919","2699","3792,1011,3974","134","16"]"
- }, {
- "turnNum": "31/05/2021-1231",
- "openNum": "0,3,1,7,0,5",
- "openTime": "2021-05-31 22:23:15",
- "detail": "["031705","25046","97310","98690,88626","93352,38055,10531,48162,71396,00696,85605","7051","1485,1942,7796","805","21"]"
- }]
- }
- }
复制代码
解析JSON样例
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <%
- Option Explicit
- session.codepage=65001
- response.charset="utf-8"
- Response.LCID = 2052 ' 中国 LCID (使用你当地的LCID).
- ' 也可以在当前页面声明,或者在全站session声明LCID属性.
- %>
- <!--#include file="jsonObject.class.asp" -->
- <%
- '//json解析开始
- dim url,item
- dim str_json
- dim jsonObj,jsonString,outputObj
- dim arr
-
- set jsonObj = new JSONobject '//创建对象
- jsonString ="样例代码"
- '//解析开始
- jsonObj.parse(jsonString)
- 'jsonObj.Write()
- Set arr = jsonObj("t")("issueList")
- For each item in arr.items
-
- '//print result
-
-
- response.Write "turnNum:"&item("turnNum")&", "
- response.Write "openNum:"&item("openNum")&", "
- response.Write "openTime:"&item("openTime")&"<br>"
-
-
- Next
-
- Set arr=nothing
- set jsonObj=nothing
- %>
复制代码
- Set objJSON= new JSONobject '//创建对象
- objJSON.parse(strJson)
- Set arrJSON= objJSON("TTASP")
- for i = 0 to arrJSON.length - 1
-
- Set itemJson = arrJSON(i)
- response.write itemJson("耗材名称")
- response.write "<br>"
- Set itemJson =Nothing
-
- next '
- '
- Set arrJSON=nothing
- Set objJson=nothing
复制代码 |
|