C#配json字典并调用
1.添加引用
Newtonsoft.dll
2.引用
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
3.配json字典
public string ReturnDic()
{
string Arr = "{" +
"\"aa\":\"11\"" +
",\"bb\":\"22\"" +
",\"cc\":\"33\"" +
",\"dd\":\"44\"" +
"}";
return Arr;
}
4.调用
string dic = Dic.ReturnDic();
JObject jo = (JObject)JsonConvert.DeserializeObject(dic);
jo.Property(“aa”);