.NET 库: Newtonsoft.Json
下载地址:http://www.newtonsoft.com/json
Json 转 Dictionary:
string json = "{'test','123'}";
Dictionary<string, object> dic= JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
Dictionary 转 Json:
Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add("test","123");
string json = JsonConvert.SerializeObject(dic);
网友评论