Foxtable(狐表)用户栏目专家坐堂 → 如何获取json的键值


  共有3192人关注过本帖树形打印复制链接

主题:如何获取json的键值

帅哥哟,离线,有人找我吗?
fntfgz
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:424 积分:5115 威望:0 精华:0 注册:2012/11/16 8:21:00
如何获取json的键值  发帖心情 Post By:2020/12/10 16:19:00 [只看该作者]

老师,我有下面一段json代码
{"searchValue":null,"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"params":{},"undergraduateId":1,"serialNumber":"1","schoolName":"北京大学","schoolCode":"4111010001","competentAuthority":"教育部","provinceCity":"北京市","city":"海淀区","schoolLevel":"本科","schoolNature":"公办","whether985":"985","whether211":"211","firstInstitutions":"A","firstDiscipline":"是","researchQualification":"是","autonomousMarking":"是","typeInstitution":"综合","internetSite":"http://www.pku.edu.cn/","schoolAddress":"燕园校区(校本部):北京市海淀区颐和园路5号\n医学部:北京市海淀区学院路38号\n昌平校区:北京市昌平区十三陵镇西山口村\n大兴校区:北京市大兴工业开发区金苑路24号\n无锡校区:无锡市滨湖区未名路\n深圳研究生院:深圳市南山区丽水路2199号","admissionsOfficePhone":"010-62751407","admissionsOfficeEmail":"bdzsb@pku.edu.cn","reserved1":null,"reserved2":null}

我想提取里面的键值,咱们的Foxtable采用的是第三方库Newtonsoft.JSON。请问有没有相关的命令


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/10 16:53:00 [只看该作者]

Dim json As String = "{'name':'李云龙','age':'36'}"
Dim jo As JObject = JObject.Parse(json)
For Each it As object In jo
        Output.Show(it.key & "-" & it.value)
Next

 回到顶部