/// <summary> /// 保存配置类实例 /// </summary> /// <param name="configinfo"></param> /// <returns></returns> public static bool SaveConfig(EncryptConfig configinfo) { EncryptConfigFileManager rcfm = new EncryptConfigFileManager(); EncryptConfigFileManager.ConfigInfo = configinfo; return(rcfm.SaveConfig()); }
static EncryptConfigs() { configinfo = EncryptConfigFileManager.LoadConfig(); EncryptConfigTimer.AutoReset = true; EncryptConfigTimer.Enabled = true; EncryptConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed); EncryptConfigTimer.Start(); }
public static string filename = null; //配置文件所在路径 /// <summary> /// 初始化文件修改时间和对象实例 /// </summary> static EncryptConfigFileManager() { if (File.Exists(ConfigFilePath)) { fileoldchange = File.GetLastWriteTime(ConfigFilePath); configinfo = (EncryptConfig)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(EncryptConfig)); } }
/// <summary> /// 重设配置类实例 /// </summary> public static void ResetConfig() { configinfo = EncryptConfigFileManager.LoadConfig(); }