Ejemplo n.º 1
0
 private void checkBox3_CheckedChanged(object sender, EventArgs e)
 {
     if (!checkBox3.Checked)
     {
         ChangeProxy.ResetProxySockEntireComputer();
     }
 }
Ejemplo n.º 2
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                useProxifier = true;
                //reset value of 3 browsers
                ChangeProxy.ResetProxySockEntireComputer();

                foreach (System.Diagnostics.Process myProc in System.Diagnostics.Process.GetProcesses())
                {
                    if (myProc.ProcessName == "firefox")
                    {
                        System.Diagnostics.Process cmd;
                        cmd = System.Diagnostics.Process.Start("resetSocksFF.exe");
                        cmd.WaitForExit();
                    }
                }
            }
            else
            {
                useProxifier = false;
                foreach (System.Diagnostics.Process myProc in System.Diagnostics.Process.GetProcesses())
                {
                    if (myProc.ProcessName == "Proxifier")
                    {
                        myProc.Kill();
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (useProxifier)
     {
         ProxifierReload("127.0.0.1", 9951);
     }
     else
     {
         ChangeProxy.ResetProxySockEntireComputer();
     }
 }
Ejemplo n.º 4
0
        //filechooser txt file => proxyWithCityHttpRequest.txt
        public void GetCityOfProxyHttpRequest(System.Windows.Forms.Label label3)
        {
            File.Delete("proxyWithCityHttpRequest.txt");
            int block = 50;

            for (int j = 0; j <= File.ReadAllLines(proxyfile).Count() / block; j++)
            {
                label3.Invoke((System.Windows.Forms.MethodInvoker)(() => label3.Text = "checking..." + j + "/" + File.ReadAllLines(proxyfile).Count() / block));
                ChangeProxy.ResetProxySockEntireComputer();

                CheckProxyThread[] thr = new CheckProxyThread[1000];
                Thread[]           tid = new Thread[1000];

                //MyThread thr1 = new MyThread();
                //MyThread thr2 = new MyThread();

                //Thread tid1 = new Thread(new ThreadStart(thr1.Thread1));
                //Thread tid2 = new Thread(new ThreadStart(thr2.Thread1));

                //tid1.Start();
                //tid2.Start();
                System.IO.DirectoryInfo downloadedMessageInfo = new DirectoryInfo("temp\\");

                foreach (FileInfo file in downloadedMessageInfo.GetFiles())
                {
                    file.Delete();
                }

                int num;
                if (j == File.ReadAllLines(proxyfile).Count() / block)
                {
                    num = File.ReadAllLines(proxyfile).Count();
                }
                else
                {
                    num = (j + 1) * block;
                }
                for (int i = j * block; i < num; i++)
                {
                    string proxy = ReadProxyAtLine(i + 1, proxyfile);
                    thr[i]      = new CheckProxyThread();
                    tid[i]      = new Thread(new ThreadStart(thr[i].ProxyCheckHttpRequest));
                    tid[i].Name = proxy;
                    tid[i].Start();
                }

                for (int i = j * block; i < num; i++)
                {
                    tid[i].Join();
                }

                label3.Invoke((System.Windows.Forms.MethodInvoker)(() => label3.Text = "finish check !!!"));
            }
        }