Unity Json解析
2017-07-02 本文已影响0人
卓灬不凡
.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);