老师好!我想得到下图中的格式,name不带引号,具体的值是单引号,并且name和value成为一行。需要怎样修改代码?
此主题相关图片如下:截屏图片.jpg
代码:
Dim jo As New JObject
Dim ja As New JArray
jo("dept") = "销售部"
jo("mpr") = "赵刚"
jo("staff") = ja '
ja.Add(New JObject) '给数组添加两个对象成员
ja.Add(New JObject)
ja(0)("value") = 36
ja(0)("name") = "李云龙"
ja(1)("value") = 26
ja(1)("name") = "黄晓明"
Output.Show(jo.ToString)
输出结果:
{
"dept": "销售部",
"mpr": "赵刚",
"staff": [
{
"value": 36,
"name": "李云龙"
},
{
"value": 26,
"name": "黄晓明"
}
]
}