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 關注
- 174 瀏覽
添加回答
舉報