Пример #1
0
        public Boolean setip(string ip)
        {
            RefreshIESettings(ip);
            IEProxy ie = new IEProxy(ip);

            return(ie.RefreshIESettings());
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string proxy = this.textBox1.Text;

            RefreshIESettings(proxy);
            IEProxy ie = new IEProxy(proxy);

            MessageBox.Show(ie.RefreshIESettings().ToString());
        }
Пример #3
0
		public void SetProxy(string host, int port)
		{
			port = port > 0 ? port : 80;
			host = string.IsNullOrEmpty(host) ? "127.0.0.1" : host.Trim();
			Application.DoEvents();
			var ie = new IEProxy("http://" + host + ":" + port.ToString());
			ie.RefreshIESettings();
			Application.DoEvents();
		}
Пример #4
0
        public void SetProxy(string host, int port)
        {
            port = port > 0 ? port : 80;
            host = string.IsNullOrEmpty(host) ? "127.0.0.1" : host.Trim();
            Application.DoEvents();
            var ie = new IEProxy("http://" + host + ":" + port.ToString());

            ie.RefreshIESettings();
            Application.DoEvents();
        }
Пример #5
0
        private void FormPlayer_Load(object sender, EventArgs e)
        {
            //调整窗口大小
            switch (AcPlayConfiguration.Config.PlayerName.ToUpper())
            {
            case "ACFUN":
                this.ClientSize = new System.Drawing.Size(970, 471);
                redirector      = new AcfunRedirector();
                break;

            case "BILIBILI":
                this.ClientSize = new System.Drawing.Size(970, 514);
                redirector      = new BilibiliRedirector();
                break;

            case "MUKIOPLAYER":
                redirector = new MukioRedirector();
                break;
            }

            Thread thProxy = new Thread(new ThreadStart(new MethodInvoker(() =>
            {
                proxy = new AcplayHttpProxy("http://127.0.0.1:" + AcPlayConfiguration.Config.ProxyServerPort.ToString() + "/", redirector);
                proxy.StartProxy();
            })));

            Thread wait = new Thread(new ThreadStart(new MethodInvoker(() =>
            {
                while (!ServerStartStatus.ProxyServerStarted)
                {
                    Thread.Sleep(500);
                }

                this.Invoke(new MethodInvoker(() =>
                {
                    Application.DoEvents();
                    ie = new IEProxy("127.0.0.1:" + AcPlayConfiguration.Config.ProxyServerPort.ToString());
                    ie.RefreshIESettings();
                    Application.DoEvents();
                    Thread.Sleep(1000);
                    web.Navigate(redirector.GetUrl());
                }));
            })));

            thProxy.IsBackground = true;
            thProxy.Start();
            wait.Start();
            this.Icon = Properties.Resources.acplay;
        }
Пример #6
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            DataTable        dt = (DataTable)e.Argument;
            BackgroundWorker bw = (BackgroundWorker)sender;

            foreach (DataRow dr in dt.Rows)
            {
                //没有取消后台操作
                if (!bw.CancellationPending)
                {
                    string proxy = string.Format("{0}:{1}", dr["IP"].ToString(), dr["Port"]);
                    if (Ping(dr["IP"].ToString()))
                    {
                        RefreshIESettings(proxy);
                        IEProxy ie = new IEProxy(proxy);
                        if (ie.RefreshIESettings())
                        {
                            webBrowser1.Navigate(txt_url.Text.Trim(), null, null, null);
                        }
                    }
                }
            }
        }