예제 #1
0
 public void Save(NetscanSettingModel model)
 {
     if (File.Exists(_filePath))
     {
         File.Copy(_filePath, _filePathBackup, true);
     }
     File.WriteAllText(_filePath, JsonConvert.SerializeObject(model, Formatting.Indented));
 }
예제 #2
0
 public NetscanConfiguration()
 {
     if (!File.Exists(_filePath))
     {
         _settings = new NetscanSettingModel {
             Values = Values()
         };
     }
     try {
         _settings = JsonConvert.DeserializeObject <NetscanSettingModel>(File.ReadAllText(_filePath));
     }
     catch (Exception) {
         _settings = new NetscanSettingModel {
             Values = Values()
         };
     }
 }
예제 #3
0
 public void Save(NetscanSettingModel model)
 {
     FileWithAcl.WriteAllText(_filePath, JsonConvert.SerializeObject(model, Formatting.Indented), "644", "root", "wheel");
 }