Code:
Using system;using system.collections.generic;using system.linq;using system.text;using newtonsoft.json;//Reference Namespace Namespace consoleapplication3{ class program { static void main (string[] args) { serializer (); Deserialize (); console.readkey (); } //Serialization private static void serializer () { dictionary <string, string>&nBsp;dic = new dictionary<string, string> (); dic["Provincesysno"] = "; " var str = jsonconvert.serializeobject (DIC); console.writeline (str); } //deserialization private static void deserialize () { string json = "{\" provincesysno\ ": \" 19\ "}"; var dic = JsonConvert.DeserializeObject<Dictionary<string, object>> (JSON); foreach (var s in dic) { console.writeline ("Key:{0},value:{1}", s.key, s.value); } } }}
: Http://pan.baidu.com/s/1jGxkCjs
This article is from the "program Ape's Home--hunter" blog, please be sure to keep this source http://962410314.blog.51cto.com/7563109/1669810
Serialization and deserialization