コード例 #1
0
ファイル: FormPlayer.cs プロジェクト: wly5556/acdown
        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;
        }
コード例 #2
0
ファイル: FormPlayer.cs プロジェクト: kwedr/acdown
		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;
		}