private void checkBox3_CheckedChanged(object sender, EventArgs e) { if (!checkBox3.Checked) { ChangeProxy.ResetProxySockEntireComputer(); } }
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(); } } } }
private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { if (useProxifier) { ProxifierReload("127.0.0.1", 9951); } else { ChangeProxy.ResetProxySockEntireComputer(); } }
//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 !!!")); } }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string proxy = dataGridView1.CurrentCell.Value.ToString(); if (useProxifier) { ProxifierReload(proxy.Split(':')[0], int.Parse(proxy.Split(':')[1])); } //neu ko dung proxifier else { if (checkBox3.Checked) { ChangeProxy.SetSockEntireComputer(proxy); } //set socks for firefox, ff can't use system sock error if (checkBox4.Checked) { System.Diagnostics.Process cmd; using (System.IO.StreamWriter file = new System.IO.StreamWriter("autoItReadProxy.txt")) { file.Write(proxy); } cmd = System.Diagnostics.Process.Start("changeSocksFF.exe"); cmd.WaitForExit(); } } //change systemtime if (systemTime) { ChangeProxy.ChangeTimezone(dataGridView1.CurrentRow.Cells[5].Value.ToString()); } else { ChangeProxy.ResetTimezone(); } label4.Text = proxy; }
private void button4_Click(object sender, EventArgs e) { ChangeProxy.SetSockEntireComputer("1.1.1.1:1"); }