0
如何在List<String>
中抓取所有标记?
这里是JSON字符串:C#提取使用Newtonsoft.Json的json数组对象
{
"error": null,
"jsonrpc": "2.0",
"id": 0,
"result": {
"paginator": null,
"cat_count": {},
"last_post_date": 386623075949839,
"post_list": [
{
"hc": false,
"p2": 4,
"token": "LnARJZCmt"
},
{
"hc": false,
"p2": 4,
"token": "BuD2oIs3N"
},
{
"p2": 4,
"token": "89NaBsAha",
"hc": false,
}
],
"error": 0
}
}
我使用Newtonsoft.Json
这里是我的尝试:
var obj = JObject.Parse(json);
string next_search_val = (string)obj["result"]["last_post_date"];
var tokens = obj["result"]["post_list"]["token"]; > Fix this line for me > I have error here
$ ..>那是什么意思呢? – MoonLight
@MoonLight [用JSONPath查询JSON](https://www.newtonsoft.com/json/help/html/QueryJsonSelectTokenJsonPath.htm) –
欣赏它并感谢。 – MoonLight