namespace IStation.Service { /// /// /// public partial class Station { private readonly string _filePath = Path.Combine( Settings.ParasHelper.LocalFile.DataFolderDirectory, Settings.ParasHelper.LocalFile.StationFile); Model.Station _model = null; /// /// 获取 /// public Model.Station Get() { if (_model == null) { if (!File.Exists(_filePath)) return default; var json = File.ReadAllText(_filePath); _model = JsonHelper.Json2Object(json); } return _model; } /// /// 保存 /// /// /// public bool Save(Model.Station model) { _model = model; if (model == null) return false; var json = JsonHelper.Object2Json(model); File.WriteAllText(_filePath, json); return true; } } }