<del id="jzr72"><form id="jzr72"></form></del>

    <del id="jzr72"><form id="jzr72"></form></del>
    <code id="jzr72"></code>

    1. 
      

      艾恩Asp生成Json數(shù)據(jù)類

      2023/2/22 17:11:41來源:CSDN83 閱讀

        dim json,json1,json2,json3,jsonStr,json4
        set json=new Aien_Json				'定義主json對(duì)象
        json.JsonType="object"				'json數(shù)據(jù)結(jié)構(gòu)為對(duì)象
        json.addData "name","panzhiming"		'添加數(shù)據(jù)
        json.addData "isboy",true
        json.addData "age",23
        json.addData "luckyNumber",Array(34,31,42)
        
        set json2=new Aien_Json				'定義一個(gè)json子對(duì)象
        json2.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對(duì)象
        json2.addData "wife","xiaoming"		'添加數(shù)據(jù)
        json2.addData "school","miliangxiaoxue"
        	
        set json3=new Aien_Json				'定義一個(gè)json子對(duì)象
        json3.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對(duì)象
        json3.addData "chinese",85			'添加數(shù)據(jù)
        json3.addData "english",90
        
        set json4=new Aien_Json				'定義一個(gè)json子對(duì)象
        json4.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對(duì)象
        json4.addData "chinese",85			'添加數(shù)據(jù)
        json4.addData "english",90
        
        set json5=new Aien_Json				'定義一個(gè)json子對(duì)象
        json5.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對(duì)象
        json5.addData "chinese",85			'添加數(shù)據(jù)
        json5.addData "english",90
        
        		
        set json1=new Aien_Json				'定義一個(gè)json子對(duì)象
        json1.JsonType="array"				'數(shù)據(jù)結(jié)構(gòu)為數(shù)組
        json1.addData "color1","green"		'添加數(shù)據(jù)
        json1.addData "color2","red"
        
        json2.addData "classes",Array(json3,json4)		'把json3添加到j(luò)son2中,鍵名為classes	
        json.addData "colors",json1			'把json1添加到j(luò)son中,鍵名為colors
        json.addData "others",json2		'把json2添加到j(luò)son中,鍵名為others
        json.addData "data",json5	
        
        
        
        jsonStr=json.getJson(json)			'獲取最后生成的json字符串,本函數(shù)只有第一次調(diào)用有效
        
        set json4=nothing
        set json3=nothing
        set json2=nothing
        set json1=nothing
        set json=nothing
        
        Response.write jsonStr

        '//輸出生成數(shù)據(jù)

        {
            "name": "panzhiming", 
            "isboy": "true", 
            "age": "23", 
            "luckyNumber": [
                "34", 
                "31", 
                "42"
            ], 
            "colors": [
                "green", 
                "red"
            ], 
            "others": {
                "wife": "xiaoming", 
                "school": "miliangxiaoxue", 
                "classes": [
                    {
                        "chinese": "85", 
                        "english": "90"
                    }, 
                    {
                        "chinese": "85", 
                        "english": "90"
                    }
                ]
            }, 
            "data": {
                "chinese": "85", 
                "english": "90"
            }
        }

        來源參考:https://blog.csdn.net/boys1999/article/details/43575811

        下一條:asp各種文件操作UTF-8

        上一條:本地瀏覽器歷史記錄清除方法

      棗莊西橋網(wǎng)絡(luò)微信小程序微信小程序

      棗莊西橋網(wǎng)絡(luò)手機(jī)站二維碼掃描手機(jī)瀏覽

      日韩AV一区五月天,亚洲成Av人片乱码色午夜,欧美婷婷六月丁香综合色,日本另类亚洲色区 国产一级一交一乱视频 久久久久久a亚洲欧洲AV
      <del id="jzr72"><form id="jzr72"></form></del>

        <del id="jzr72"><form id="jzr72"></form></del>
        <code id="jzr72"></code>

        1.