我正在尝试将 JObject 转换为特定的属性列表,但我不知道如何实现。
这是JSON:
{
"response":{
"result":1,
"resultcount":1,
"collectiondetails":[
{
"publishedfileid":"1717998413",
"result":1,
"children":[
{
"publishedfileid":"109643223",
"sortorder":1,
"filetype":0
},
{
"publishedfileid":"1498270631",
"sortorder":2,
"filetype":0
},
{
"publishedfileid":"162218499",
"sortorder":3,
"filetype":0
},
{
"publishedfileid":"1419266438",
"sortorder":4,
"filetype":0
},
{
"publishedfileid":"245482078",
"sortorder":5,
"filetype":0
}
]
}
]
}
}
我想列出“publishedfileid”属性的值。
我开始这样做 Dim rawJson = Newtonsoft.Json.Linq.JObject.Parse(jsonString)
但我不知道在那之后该怎么办。
感谢您花时间回答我。 问候,
答案 0 :(得分:0)
问题解决了 @Jimi
将我的旧代码编辑为 Dim rawJson = JsonConvert.DeserializeObject(Of Rootobject)(jsonString)
并循环遍历 rawJson.response.collectiondetails(0).children