反序列化一个object var str1 = "{id:1,name:'111',x:[1,2,3],y:{a:'ssss',b:'dddd'}"; var obj1 = JsonConvert.DeserializeAnonymousType(str1, new {id=1,name="1",x=new[]{1,2},y=new{a="1",b="b"}}); 反序列化一个数组 var str2 = "[{id:…
摘自:http://blog.csdn.net/cdefg198/article/details/7520398 using System.IO; using System.Web.Script.Serialization; using System.Runtime.Serialization.Json; public static List<T> JSONStringToList<T>(this string JsonStr) { JavaScriptSerializer Ser…
(1)JSON.parse 函数 var json = '{"name":"GDT","age":23,"University":"GDUT"}'; var info = JSON.parse(json); //解析为JSON对象 document.write(info.name + ' is a student of ' + info.University + ' and he is ' + info.a…