使用Jpath 对Json字符串进行解析
var response = "你的json";
var jobject = response.ToJObject(); var titles = jobject.SelectToken("data.examPaper.titles[0].questions").Children(); var returnIds = new List<string>(); foreach (var item in titles) returnIds.Add(item["id"].Value<string>());
结构如下
stay hungry stay foolish!