如何在C#ASP.NET中使用for each循环读取json
数据我有以下json
的输出数据,我想使用foreach
循环读取red
突出显示的数据education
。下面是我的json
数据。
{
"data": {
"certifications": [],
"dateOfBirth": null,
"education": [
{
"id": 29364744,
"organization": "Texas A&M University",
"accreditation": {
"education": "Bachelor of Science",
"educationLevel": "bachelors",
"inputStr": "Bachelor of Science Computer Science",
"matchStr": ""
},
"grade": null,
"location": {
"formatted": "College Station, TX, USA",
"streetNumber": null,
"street": null,
"apartmentNumber": null,
"city": "College Station",
"postalCode": null,
"state": "Texas",
"country": "United States",
"rawInput": "College Station, TX",
"countryCode": "US",
"latitude": 30.627977,
"longitude": -96.3344068
},
"dates": {
"startDate": "2005-01-01",
"completionDate": "2009-01-01",
"isCurrent": false,
"rawText": "2005 - 2009"
}
}
]
}
}
个字符
3条答案
按热度按时间vom3gejh1#
你可以试试这个
字符串
输出量
型
ztyzrc3y2#
创建一个具有相关属性的类,并将该类型传递给DeserializeObject。
字符串
rnmwe5a23#
你可以用你的json结构创建一个类visual studio有一个选项
的数据
在使用jsonnet之后,您可以反序列化消息
字符串