JSON解析 Foxtable用非常方便的方法实现JSON和XML的解析与生成。 在命令窗口执行:
Dim json As String = "{'name':'李云龙','age':'36'}"
Dim jo As JObject = JObject.Parse(json)
Output.Show(jo("name"))
Output.Show(jo("age"))
显示的结果是:
李云龙
36 在命令窗口执行: Dim xml As String = "<xml><to>George</to><from>John</from><content>Don't forget the meeting!</content></xml>"
Dim xo As XObject = XObject.Parse(xml)
Output.Show(xo("to"))
Output.Show(xo("from"))
Output.Show(xo("content")) 显示的结果为:
George
John
Don't forget the meeting!
|