예제 #1
0
        private void Form_Redis_Load(object sender, EventArgs e)
        {
            var lst_db = new List <object>();

            for (int i = 0; i < 15; i++)
            {
                lst_db.Add(new { Id = i, Text = i });
                //var item=new selectit
            }
            this.comboBox_RedisDbList.DataSource    = lst_db;
            this.comboBox_RedisDbList.ValueMember   = "Id";
            this.comboBox_RedisDbList.DisplayMember = "Text";
            var redisConfig = RedisConfig.LoadConfig();

            if (null != redisConfig)
            {
                this.txt_redis_ip_address.Text          = redisConfig.IpAddress;
                this.txt_redis_port.Text                = redisConfig.Port.ToString();
                this.txt_redis_pwd.Text                 = redisConfig.Pwd;
                this.comboBox_RedisDbList.SelectedValue = redisConfig.WhichDb;
            }
            else
            {
                this.comboBox_RedisDbList.SelectedIndex = 0;
            }

            //订阅发送cookie到远程的事件
            CrawlerCookiesPopJob.OnSendCookiesToRemoteEvent -= Handler_OnSendCookiesToRemoteEvent;
            CrawlerCookiesPopJob.OnSendCookiesToRemoteEvent += Handler_OnSendCookiesToRemoteEvent;
        }
예제 #2
0
        public ActionResult ReLoadConfig()
        {
            //重新加载各种配置
            MongoDBConfig.LoadConfig();

            ExcludeUrlConfiguration.LoadConfig();

            UrlGenerateConfig.LoadConfig();

            RedisConfig.LoadConfig();

            SqlDispatcherConfig.LoadConfig();

            //FastDFS.Configuration.FastDFSConfigHelper.LoadConfig();

            BundleConfigManager.RegisterBundles(BundleTable.Bundles);

            string backUrl = Request.UrlReferrer == null?Url.RetechAction("Index") : Request.UrlReferrer.ToString();

            return(Redirect(backUrl));
        }