以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何实现表当前行数据直接字段顺序生成josn (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174141) |
-- 作者:cnsjroom -- 发布时间:2022/1/4 10:38:00 -- 如何实现表当前行数据直接字段顺序生成josn 如何实现表当前行数据直接字段顺序生成josn
红色部分改怎么写呢?
Dim jo As new jobject \'=jobject.fromobject()
Dim js As String =jo.Tostring()
output.show(js)
经过老师的指导: Dim jo As new jobject
For Each c As Col In Tables("普通短信").cols jo(c.name) = cstr(Tables("普通短信").current(c.name)) Next output.show(jo.Tostring()) 得到如下:
{
"ecName": "*", "apid": "*", "mobiles": "*", "sign": "*", "addserial": "", "mac": "*", "content": "我是窗口测试哈", "secretKey": "*" } [此贴子已经被作者于2022/1/25 20:22:27编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/1/4 10:41:00 -- Dim jo As new jobject for each c as col in tabls(xxx)。cols jo(c.name) = tables(xxx).current(c.name) next
|
-- 作者:cnsjroom -- 发布时间:2022/1/4 10:53:00 -- 回复:(有点蓝)Dim jo As new jobjectfor each c as... 继续麻烦老师一下 Dim jo As new jobject For Each c As Col In Tables("普通短信").cols jo(c.name) = Tables("普通短信").current(c.name) Next \'Dim js As String =jo.Tostring() \'output.show(jo.Tostring()) output.show(jo) 提示弹出 |
-- 作者:有点蓝 -- 发布时间:2022/1/4 10:57:00 -- jo(c.name) = cstr(Tables("普通短信").current(c.name)) |