纠结了两天的json数组反序列化,终于在同事的帮助下,找到方法了,特作笔记如下:
using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Text; string jsonText = "[{'a':'aaa','b':'bbb','c':'ccc'},{'a':'aaa2','b':'bbb2','c':'ccc2'}]"; JArray ja = (JArray)JsonConvert.DeserializeObject(ReceivePlaceString); // JObject o = (JObject)ja[1]; // Response.Write(o["a"]); Response.Write(ja[0]["a"]);