Exemplo n.º 1
0
 private void SaveConfig()
 {
     if (Directory.Exists(DataFileSavePath.Text) == false)
     {
         if (DialogResult.Cancel == MessageBox.Show("当前路径不存在,是否创建?", "保存路径设定", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
         {
             return;
         }
     }
     //保存配置信息
     ConfigUtils.DataFileSavePath   = DataFileSavePath.Text;
     ConfigUtils.FirstServerAdress  = FirstServerAdress.Text;
     ConfigUtils.SecondServerAdress = SecondServerAdress.Text;
     // 初始化路径配置信息
     ConfigUtils.InitSavePath();
     // 保存默认配置文件
     ConfigUtils.SaveConfigFile();
     //保存服务器配置文件
     ConfigUtils.SaveSysConfig();
 }
Exemplo n.º 2
0
 private void Login_Load(object sender, EventArgs e)
 {
     //MessageBox.Show(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
     this.Icon = Properties.Resources.TSS;
     //加载系统默认配置
     if (ConfigUtils.LoadConfigFile() == false)
     {
         ConfigSet c = new ConfigSet();
         c.ShowDialog(this);
     }
     AdminConfigFile = ConfigUtils.DataFileSavePath + @"\" + FilePathUtils.LOCAL_CFG + FilePathUtils.LOCAL_ADMIN_SYS + FilePathUtils.LOCAL_FILE_TYPE;
     if (File.Exists(AdminConfigFile) == false)//第一次使用
     {
     }
     else
     {
         this.Password.Text  = "请输入密码";
         this.UserID.Visible = false;
         PasswordConfig      = File.ReadAllText(AdminConfigFile);
         //加载系统配置信息
         ConfigUtils.LoadSysConfig();
     }
 }
Exemplo n.º 3
0
        private void timer_Tick(object sender, EventArgs e)
        {
            timer.Stop();
            //服务器连接判断
            if (ConfigUtils.NetConnect == true)
            {
                #region 读取配置文件
                MessageLBL.Text = "读取个人关注";
                LoadPB.Value    = 10;
                MessageLBL.Refresh();
                Thread.Sleep(1000);
                ConfigUtils.LoadUsrConfig();
                #endregion

                #region 获取最新服务器列表
                MessageLBL.Text = "获取最新服务器列表";
                LoadPB.Value    = 20;
                MessageLBL.Refresh();
                Thread.Sleep(1000);
                ConfigUtils.LoadServerListConfig();
                #endregion

                #region 获取分享更新
                MessageLBL.Text = "获取今日热点信息";
                LoadPB.Value    = 30;
                Thread.Sleep(2000);
                ResourceUtils.LoadResourcesTop10();

                MessageLBL.Text = "获取全部分类信息";
                LoadPB.Value    = 40;
                Thread.Sleep(2000);
                TypeUtils.LoadAllTypes();

                MessageLBL.Text = "获取最新分享信息";
                LoadPB.Value    = 50;
                Thread.Sleep(2000);
                ResourceUtils.LoadAllResources();

                MessageLBL.Text = "获取最新主题信息";
                LoadPB.Value    = 60;
                Thread.Sleep(2000);
                SeriesUtils.LoadAllSeries();
                #endregion

                #region 更新个人订阅
                MessageLBL.Text = "获取我关注的分类信息";
                LoadPB.Value    = 70;
                MessageLBL.Refresh();
                Thread.Sleep(1000);
                TypeUtils.LoadMyOrderTypes();

                MessageLBL.Text = "获得我关注的主题信息";
                LoadPB.Value    = 80;
                MessageLBL.Refresh();
                Thread.Sleep(1000);
                SeriesUtils.LoadMyOrderSeriess();
                #endregion
            }

            #region 加载成功
            LoadPB.Value    = 90;
            MessageLBL.Text = "完成最后加载内容...";
            MessageLBL.Refresh();
            #endregion

            this.Close();
        }