Exemple #1
0
        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <param name="configinfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(SoftInfoConfig configinfo)
        {
            SoftInfoConfigFileManager rcfm = new SoftInfoConfigFileManager();

            SoftInfoConfigFileManager.ConfigInfo = configinfo;
            return(rcfm.SaveConfig());
        }
        public static string filename = null;                                                                                                   //配置文件所在路径

        /// <summary>
        /// 初始化文件修改时间和对象实例
        /// </summary>
        static SoftInfoConfigFileManager()
        {
            if (File.Exists(ConfigFilePath))
            {
                fileoldchange = File.GetLastWriteTime(ConfigFilePath);
                configinfo    = (SoftInfoConfig)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(SoftInfoConfig));
            }
        }
Exemple #3
0
 static SoftInfoConfigs()
 {
     configinfo = SoftInfoConfigFileManager.LoadConfig();
     EncryptConfigTimer.AutoReset = true;
     EncryptConfigTimer.Enabled   = true;
     EncryptConfigTimer.Elapsed  += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
     EncryptConfigTimer.Start();
 }
Exemple #4
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     configinfo = SoftInfoConfigFileManager.LoadConfig();
 }