Foxtable(狐表)用户栏目专家坐堂 → [求助]如何判断JToken的类型?


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

主题:[求助]如何判断JToken的类型?

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


加好友 发短信
等级:超级版主 帖子:111414 积分:567140 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/9/13 12:02:00 [显示全部帖子]

Dim json As String = "{""name"":""John Doe"",""age"":30,""isEmployed"":true,""skills"":[""C#"",""VB.NET"",""SQL""],""address"":{""street"":""123 Main St"",""city"":""Anytown"",""zip"":""12345""}}"
Dim jo As JObject = JObject.Parse(json)
For Each it As Object In jo 
    Output.Show(it.value.Type)
Next

For Each item As JTokenType In [Enum].GetValues(GetType(JTokenType))
    Output.Show(item & "-" & item.Tostring())
Next

 回到顶部