public string GetConfigFile() { string confiFileData = CryptFiles.Decrypt(configFile, cryptCredentials); CryptFiles.Encrypt(configFile, cryptCredentials); return(confiFileData); }
public void SetValue(string section, string key, string value) { CryptFiles.Decrypt(configFile, cryptCredentials); configParser = new ConfigParser(configFile); configParser.SetValue(section, key, value); configParser.Save(configFile); CryptFiles.Encrypt(configFile, cryptCredentials); }
public string GetValue(string section, string key) { string file = CryptFiles.Decrypt(configFile, cryptCredentials); configParser = new ConfigParser(configFile); string value = configParser.GetValue(section, key); CryptFiles.Encrypt(configFile, cryptCredentials); return(value); }
public Config(string configFile, CryptCredentials credentials) { if (!File.Exists(configFile)) { File.WriteAllText(configFile, _DEFAULT_CONFIG); CryptFiles.Encrypt(configFile, credentials); } this.configFile = configFile; cryptCredentials = credentials; }
public string GetLogFile(string dateTime) { string file = CreateLogFileName(dateTime, ".txt"); CryptFiles.Decrypt(file, credentials); string fileData = File.ReadAllText(file); CryptFiles.Encrypt(file, credentials); return(fileData); }
public void Log(string data) { string currentLogFile = CreateLogFileName(DateTime.Now, ".txt"); if (logbuffer.Count > bufferSize) { if (File.Exists(currentLogFile)) { CryptFiles.Decrypt(currentLogFile, credentials); File.AppendAllText(currentLogFile, data); CryptFiles.Encrypt(currentLogFile, credentials); } else { File.AppendAllText(currentLogFile, data); CryptFiles.Encrypt(currentLogFile, credentials); } } else { logbuffer.Add(data); } }