string jsonStr = "{\"name\":\"张三\",\"age\":\"10\"," +
"\"classroom\":{\"name\":\"1年级1班\",\"desc\":\"描述\"}," +
"\"students\":[{\"name\":\"小名\"},{\"name\":\"小红\"}]}";
JObject jObject = JObject.Parse(jsonStr);
var name = jObject["name"].ToString();
var age = jObject.GetValue("age").ToString();
var banji = jObject["classroom"]["name"].ToString();
var ns = "";
JArray jArray = JArray.Parse(jObject["students"].ToString());
foreach (var arr in jArray)
{
JObject jObj = JObject.Parse(arr.ToString());
string n = jObj["name"].ToString();
ns += " " + n;
}
var con = banji + " " + name + " " + age + "\n students:" + ns;