我从Facebook API获得了一个JSON字符串,在其中有一个节点的名称根据其内容而变化,例如有时它是45,或者58等。它可以是任何数字。我想要获取它的值。如何获得?
{
"data": [
{
"id": "1492292372_10201810786059989",
"created_time": "2014-04-05T09:00:54+0000"
},
{
"id": "1492292372_10201804679827337",
"created_time": "2014-04-04T07:29:07+0000"
},
{
"id": "1492292372_10201804649306574",
"created_time": "2014-04-04T07:10:33+0000"
},
{
"id": "1492292372_10201801316823264",
"created_time": "2014-04-03T18:31:50+0000"
},
{
"id": "1492292372_10201798962284402",
"created_time": "2014-04-03T06:24:47+0000"
},
{
"message_tags": {
"0": [
{
"id": "1492292372",
"name": "Yawar Sohail",
"type": "user",
"offset": 0,
"length": 12
}
],
"15": [
{
"id": "1489845168",
"name": "Zeeshan Anjum",
"type": "user",
"offset": 15,
"length": 13
}
]
},
"id": "1492292372_10201796274777216",
"created_time": "2014-04-02T17:57:05+0000"
},
{
"id": "1492292372_10201794080482360",
"created_time": "2014-04-02T07:26:23+0000"
},
在 message_tags 中有两个节点 [0 和 15],它们根据其偏移值动态更改。我想要这些节点中的名称、类型和 ID。
message_tags
数组中的键/值对?如果你从Facebook获取它们时甚至都不知道它们是什么,为什么还需要显式引用键?你使用的JSON.Net代码在哪里?可以让我们看一下吗?你具体卡在哪里了? - user456814