以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  JSON的空值  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=130556)

--  作者:chenjiu6202
--  发布时间:2019/1/25 10:52:00
--  JSON的空值

在生成json的时候,产生了很多空{},不知为什么,麻烦哪位老师看看下面的代码

 

Dim Val() As String = {"0","1","2","3","4","5","6","7","8","9"}
Dim Vcl() As String = {"1","2","3","4","5","6","7","8","9"}
Dim job As New JObject
Dim jb As New JArray
Dim jd As New JArray
Dim ja As New JArray
job("data") = ja
For i As Integer = 0 To Vcl.Length - 1
    ja.Add(new jobject)
    ja(i)("value") = 100000 + 10000*i
    ja(i)("text") = Vcl(i)
    ja(i)("children") = jb
    For it As Integer = 0 To Val.Length - 1
        jb.Add(new jobject)
        jb(it)("value") = 110001 + 1000*it
        jb(it)("text") = Val(it)
        jb(it)("children") = jd
        For ic As Integer = 0 To Val.Length - 1
            jd.Add(new jobject)
            jd(ic)("value") = 111000 + 100*ic + ic
            jd(ic)("text") = ic
        Next
    Next
Next
Output.Logs("调试日志").add(job.Tostring)
Output.Logs("调试日志").Save("D:\\abc.txt",True)


--  作者:有点甜
--  发布时间:2019/1/25 12:56:00
--  

 

请说明你需要生成什么json数据?具体说明逻辑。

 

 


--  作者:chenjiu6202
--  发布时间:2019/1/26 21:27:00
--  
已找到方法了