<b id="wujfn"></b>

      <cite id="wujfn"></cite>
      <b id="wujfn"><meter id="wujfn"></meter></b>

        <ul id="wujfn"></ul>

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

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

          dim json,json1,json2,json3,jsonStr,json4
          set json=new Aien_Json				'定義主json對象
          json.JsonType="object"				'json數(shù)據(jù)結(jié)構(gòu)為對象
          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				'定義一個json子對象
          json2.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對象
          json2.addData "wife","xiaoming"		'添加數(shù)據(jù)
          json2.addData "school","miliangxiaoxue"
          	
          set json3=new Aien_Json				'定義一個json子對象
          json3.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對象
          json3.addData "chinese",85			'添加數(shù)據(jù)
          json3.addData "english",90
          
          set json4=new Aien_Json				'定義一個json子對象
          json4.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對象
          json4.addData "chinese",85			'添加數(shù)據(jù)
          json4.addData "english",90
          
          set json5=new Aien_Json				'定義一個json子對象
          json5.JsonType="object"				'數(shù)據(jù)結(jié)構(gòu)為對象
          json5.addData "chinese",85			'添加數(shù)據(jù)
          json5.addData "english",90
          
          		
          set json1=new Aien_Json				'定義一個json子對象
          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ò)手機站二維碼掃描手機瀏覽

        无码精品午夜在线视频观看不卡,欧美色综合一区二区三区,国产亚洲成人AⅤ片在线观看,日本中文字幕乱码在线精品
        <b id="wujfn"></b>

          <cite id="wujfn"></cite>
          <b id="wujfn"><meter id="wujfn"></meter></b>

            <ul id="wujfn"></ul>