3 回答
TA贡献1802条经验 获得超5个赞
下面的内容应该可以解决问题。
JArray data = (JArray)parsed["children"];
foreach(JObject children in (JObject)data){
foreach(JObject child in (JArray)children["children"]){
var value = child["html"];
}
}
TA贡献1815条经验 获得超6个赞
也许这个例子会有所帮助:
string json = @"{
'channel': {
'title': 'James Newton-King',
'link': 'http://james.newtonking.com',
'description': 'James Newton-King\'s blog.',
'item': [
{
'title': 'Json.NET 1.3 + New license + Now on CodePlex',
'description': 'Announcing the release of Json.NET 1.3, the MIT license and the source on CodePlex',
'link': 'http://james.newtonking.com/projects/json-net.aspx',
'categories': [
'Json.NET',
'CodePlex'
]
},
{
'title': 'LINQ to JSON beta',
'description': 'Announcing LINQ to JSON',
'link': 'http://james.newtonking.com/projects/json-net.aspx',
'categories': [
'Json.NET',
'LINQ'
]
}
]
}
}";
JObject rss = JObject.Parse(json);
string rssTitle = (string)rss["channel"]["title"];
string itemTitle = (string)rss["channel"]["item"][0]["title"];
JArray categories = (JArray)rss["channel"]["item"][0]["categories"];
- 3 回答
- 0 关注
- 114 浏览
添加回答
举报