天天看点

Newtonsoft.Json 时间格式设置,替换null为""

Newtonsoft.Json.JsonSerializerSettings jSetting = new Newtonsoft.Json.JsonSerializerSettings();

jSetting.NullValueHandling = Newtonsoft.Json.NullValueHandling.Include;

 jSetting.DateFormatString = "yyyy-MM-dd HH:mm:ss";

 sbContent.Append(JsonConvert.SerializeObject(gameresult, jSetting).Replace(":null,", ":\"\",").Replace(":null},", ":\"\"},"));

继续阅读