Esempio n. 1
0
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static BaseConfigInfo LoadConfig()
 {
     try
     {
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     catch
     {
         //ReviseConfig();
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     return(ConfigInfo as BaseConfigInfo);
 }
Esempio n. 2
0
        /// <summary>
        /// 初始化文件修改时间和对象实例
        /// </summary>
        static BaseConfigFileManager()
        {
            m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);

            try
            {
                m_configinfo = (BaseConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(BaseConfigInfo));
            }
            catch
            {
                if (File.Exists(ConfigFilePath))
                {
                    //ReviseConfig();
                    m_configinfo = (BaseConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(BaseConfigInfo));
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static FTPConfigInfo LoadConfig()
 {
     ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo);
     return(ConfigInfo as FTPConfigInfo);
 }
Esempio n. 4
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static FTPConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (FTPConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(FTPConfigInfo));
 }