public string WriteHeadTrain(string json) { ResultInfo resultInfo = new ResultInfo(); try { Request request = JsonConvert.DeserializeObject <Request>(json); bool item = citHelper.WriteHeadTrain(request.filepath, Convert.ToString(request.value)); if (item) { resultInfo.flag = 1; resultInfo.msg = ""; resultInfo.data = ""; } else { resultInfo.flag = 0; resultInfo.msg = "更新失败"; resultInfo.data = ""; } } catch (Exception ex) { resultInfo.flag = 0; resultInfo.msg = ex.Message; } return(JsonConvert.SerializeObject(resultInfo)); }