index
inc/config
inc/config.bak
inc/wts
inc/class/cache
inc/class/cookie
inc/class/db
inc/class/error
inc/class/fso
inc/class/function
inc/class/js
inc/class/load
inc/class/log
inc/class/pagelist
inc/class/request
inc/class/response
inc/class/route
inc/class/session
inc/class/template
inc/class/valid
inc/class/crypt/a2u
inc/class/crypt/aes
inc/class/crypt/base64
inc/class/crypt/des
inc/class/crypt/escape
inc/class/crypt/hex
inc/class/crypt/md5
inc/class/crypt/num
inc/class/crypt/rsa
inc/class/crypt/sha
inc/class/ext/array
inc/class/ext/cart
inc/class/ext/date
inc/class/ext/http
inc/class/ext/jmail
inc/class/ext/jpeg
inc/class/ext/json
inc/class/ext/jsont
inc/class/ext/mail
inc/class/ext/md5
inc/class/ext/pack
inc/class/ext/stringbuilder
inc/class/ext/tqqwry
inc/class/ext/upfile
inc/class/ext/verify
inc/class/ext/webstat
inc/class/ext/wia
inc/class/ext/xml
inc/class/ext/zip
inc/class/route/module
inc/class/route/slash
inc/module/default/control/clear
inc/module/default/control/crypt
inc/module/default/control/error
inc/module/default/control/hello
inc/module/default/control/index
inc/module/default/control/json <--
inc/module/default/control/pic
inc/module/default/control/upload
inc/module/default/control/start/site
inc/module/default/control/start/route/key
inc/module/default/control/start/route/pic
inc/module/default/control/start/route/reg
inc/module/default/control/tag/hello
inc/module/default/language/cn/hello
inc/module/default/language/en/hello
inc/module/default/model/hello
inc/module/help/control/error
inc/module/help/control/index
inc/module/help/control/install
inc/module/help/control/start/site

类描述

title Control_Json
author ekede.com
date 2018-06-09
description json演示

类方法

Index_Action()

返回

生成json串
        Set jj = New Class_Ext_Json
			jj.setKind="object"
			jj(null)="a"
			jj(null)="b"
			jj(null)="c"
			jj(null)="d"
			jj("b")="g"
		Set jj("a")= New Class_Ext_Json
			jj("a").setKind="array"
			jj("a")(null)="e"
			jj("a")(null)="f"
		    str=jj.ToString
		Set jj = nothing
		
        
rs转json串
        Set mHello = loader.LoadModel("Hello")
        Set rs = mHello.getAll
		Set jsa = New Class_Ext_Json
		jsa.setKind = "array"
		While Not (rs.EOF Or rs.BOF)
			Set jsa(Null) = New Class_Ext_Json
			jsa(Null).setKind = "object"
			For Each col In rs.Fields
				jsa(Null)(col.Name) = col.Value
			Next
			rs.MoveNext
		Wend
		str=jsa.ToString
		Set jsa=nothing
		rs.close
		set rs = nothing
		set mHello = nothing
		
        
json串解析
		str="{""a"":""1"",""b"":""2"",""c"":""3"",d:[5,{a1:{a1:11,a2:22222,a3:33}},7,8,9],e:{f:10,g:11}}"
		'
		Set jt = loader.LoadClass("Ext/JsonT")
		Set jo = jt.getJSONObject(str)
		    wts.responses.SetOutput jt.getJSArrayItem(jo.d,1).a1.a2
		Set jo = Nothing
		Set jt = Nothing