动态类型dynamic,将JSON字符串转成对象
//动态类型dynamic,将JSON字符串转成对象 var myJson = "{"name":"小明","address":"威海"}";//json字符串 var myObj = JsonConvert.DeserializeObject<dynamic>(myJson);//反序列化为 dynamic 对象
用法像js操作json一样简单方便
var name = myObj.name.Value;//name="小明" var address = myObj["address"].Value;//address="威海" myObj.name="小张"; name = myObj.name.Value;//name="小张" myObj.address = "上海"; address = myObj.address.Value;//address="上海"