/// <summary> /// json转换工具 /// </summary> public class JsonTools { /// <summary> /// 对象转JSON /// </summary> /// <param name="obj"></param> /// <returns></returns> public static string ObjectToJson(object obj) { return JsonConvert.SerializeObject(obj); } /// <summary> /// JSON转对象 ,获得dynamic类型的对象 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public static dynamic JsonToObject(string jsonString) { return JsonConvert.DeserializeObject<dynamic>(jsonString); } }