怎么下载Newtonsoft.Json就不说了,直接百度,官网有图文教程;
{上面是我要解析的字符串保存在json(string类型)中
"c": 33,
"id": 1,
"b": [
{
"id": "1_2_42_2",
"v": 1,
"bk": ""
}
],
"sn": "",
"tm": 1450073244834
}
json = "[" + json + "]";
Newtonsoft.Json.Linq.JArray js = (Newtonsoft.Json.Linq.JArray)Newtonsoft.Json.JsonConvert.DeserializeObject(json);
foreach (Newtonsoft.Json.Linq.JObject item in js)
{
string c = item["c"].ToString();
Newtonsoft.Json.Linq.JArray js0 = (Newtonsoft.Json.Linq.JArray)item["b"];
foreach (Newtonsoft.Json.Linq.JObject item1 in ja0)
{
string id = item1["id"].ToString();
string value = item1["v"].ToString();
}
}