Пример #1
0
        /// <summary>
        /// 记录程序信息
        /// </summary>
        private void WriteAppInfo()
        {
            try
            {
                IniConfigManager ini             = new IniConfigManager();
                string           path            = ini.GetUpdateAppPath();
                string           version         = ini.GetAboutVersion();
                string           serverUpdateURL = ini.GetServerUpdateURL();
                string           file            = path + "/" + appName + ".ini";

                if (!Directory.Exists(path))
                {
                    // Create the directory it does not exist.
                    Directory.CreateDirectory(path);
                }

                IniFileController iniFile = new IniFileController(file);
                iniFile.IniWriteValue(appName, "Path", GetPath.GetCurrentDirectory());
                iniFile.IniWriteValue(appName, "Version", version);
                iniFile.IniWriteValue(appName, "UpdateURL", serverUpdateURL);
            }
            catch (Exception e)
            {
                CLog4net.LogError("WriteConfig:" + e);
            }
        }
Пример #2
0
 /// <summary>
 /// 写配置文件(彭秋生要求:为广告屏请求数据用)
 /// </summary>
 private void WriteConfig()
 {
     try
     {
         IniConfigManager ini        = new IniConfigManager();
         string           configFile = ini.GetAdvPath();
         if (!File.Exists(configFile))
         {
             FileStream   fs = new FileStream(configFile, FileMode.Create, FileAccess.Write); //创建写入文件
             StreamWriter sw = new StreamWriter(fs);
             sw.WriteLine(this.about.CabinetCode);                                            //开始写入值
             sw.Close();
             fs.Close();
         }
         else
         {
             File.WriteAllText(configFile, string.Empty);
             FileStream   fs = new FileStream(configFile, FileMode.Open, FileAccess.Write);
             StreamWriter sw = new StreamWriter(fs);
             sw.WriteLine(this.about.CabinetCode);//开始写入值
             sw.Close();
             fs.Close();
         }
     }
     catch (Exception e)
     {
         CLog4net.LogError("WriteConfig:" + e);
     }
 }
Пример #3
0
        public SoftUpdateManager()
        {
            IniConfigManager ini = new IniConfigManager();

            updateUrl = ini.GetServerUpdateURL();
        }