http://bbs.9ria.com/thread-1657-1-1.html
Parse JSON in C#
http://stackoverflow.com/questions/1212344/parse-json-in-c-sharp
我的JsonHelper:
public static class JSONHelper { public static T Deserialise<T>(this string setting) where T : class { DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T)); using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(setting))) { return serializer.ReadObject(ms) as T; } } public static string Serialise(this object obj) { return Serialise(obj, obj.GetType()); } public static string Serialise(this object obj, Type type) { DataContractJsonSerializer serializer = new DataContractJsonSerializer(type); using (MemoryStream ms = new MemoryStream()) { serializer.WriteObject(ms, obj); return Encoding.UTF8.GetString(ms.ToArray()); } }