我正在使用Json.NET来解析json字符串,但是当我尝试使用SelectToken时,它返回null。此外,它似乎Json.NET阅读JSON字符串作为1个节点使用Json.NET解析Json字符串
这里是JSON
[
[{
"input_index":0,
"candidate_index":0,
"delivery_line_1":"124 Main St",
"last_line":"Cambridge MA 02138-5813",
"delivery_point_barcode":"021385813991",
"components":{
"primary_number":"125",
"street_name":"Main",
"street_suffix":"St",
"city_name":"Cambridge",
"state_abbreviation":"MA",
"zipcode":"02138",
"plus4_code":"5813",
"delivery_point":"99",
"delivery_point_check_digit":"1"
},
"metadata":{
"record_type":"H",
"county_fips":"25017",
"county_name":"New York",
"carrier_route":"C025",
"congressional_district":"08",
"building_default_indicator":"Y"
},
"analysis":{
"dpv_match_code":"D",
"dpv_footnotes":"AAN1",
"dpv_cmra":"N",
"dpv_vacant":"N",
"ews_match":false,
"footnotes":"A#H#N#"
}
}]
]
这里是代码
JArray o = JArray.Parse(page);
string something = (string)o.SelectToken("county_name");
但是它只是返回我空,我完全困惑,因为JSON.NET解析这个Json字符串有什么问题
它是一个数组...数组没有一个'county_name' ...... –
它在元数据 –
所以我怎么能检索它... –