private void button1_Click(object sender, EventArgs e) { string[] n = tb_proxies.Text.Split('\n'); foreach (string a in n) {//\r\n?|\n string neww = a.Replace("\r\n?|\n", string.Empty).Replace("\r", string.Empty).Replace("\n?", string.Empty).Replace("?", string.Empty).Replace("|", string.Empty).Replace("\n", string.Empty).Replace(" ", string.Empty); SPGlobals.addProxyToList(neww); } this.Hide(); }
public static void StartBrowser(Panel panel) { browser = new ChromiumWebBrowser("about:blank"); browser.MenuHandler = new CustomMenuHandler(); panel.Controls.Add(browser); browser.Dock = DockStyle.Fill; //browser.Width = 730; HistoryPageEdit.Startup(); if (test == false) { SPGlobals.startup(); test = true; } }
/* * public void Run() * { * while (true) * { * string getRawProxies = SPGlobals.getAllProxies(); * string[] proxies = getRawProxies.Split('\n'); * List<string> pList = new List<string>(); * string prList = ""; * foreach (string l in proxies) * { * string neww = l.Replace(" ", string.Empty).Replace("\n", string.Empty); * pList.Add(neww); * prList += neww + Environment.NewLine; * } * string execute = ""; * foreach (string n in pList) * { * var s = Regex.Split(n, "\r\n?|\n")[0]; * string address = s.Split(':')[0]; * string pport = ""; * try { pport = s.Split(':')[1]; } catch { } * try * { * * if (PingHost(address, Convert.ToInt16(pport)) == true) * { * execute += "document.getElementById('" + s + "').style.backgroundColor = '" + "lime" + "'; " + "\n"; * } * else * { * execute += "document.getElementById('" + s + "').style.backgroundColor = '" + "#fc5b53" + "'; " + "\n"; * } * } * catch { } * string[] split = execute.Split('\n'); * foreach (string o in split) * { * * try * { * RightBrowser.EvaluateScript(o, TimeSpan.FromMilliseconds(1)); * } * catch (Exception k) { MessageBox.Show(k.Message); } * * } * * } * Thread.Sleep(5000); * } * } */ /*public void Run() * { * while (true) * { * string getRawProxies = SPGlobals.getAllProxies(); * string[] proxies = getRawProxies.Split('\n'); * List<string> pList = new List<string>(); * string prList = ""; * foreach (string l in proxies) * { * string neww = l.Replace(" ", string.Empty).Replace("\n", string.Empty); * pList.Add(neww); * prList += neww + Environment.NewLine; * } * foreach (string n in pList) * { * var s = Regex.Split(n, "\r\n?|\n")[0]; * string address = s.Split(':')[0]; * string pport = ""; * try { pport = s.Split(':')[1]; } catch { } * try * { * * TestProxies(address, Int16.Parse(pport)); * } * catch { } * * } * delay(5000); * } * }*/ public void Run() { while (true) { string getRawProxies = SPGlobals.getAllProxies(); string[] proxies = getRawProxies.Split('\n'); List <string> pList = new List <string>(); string prList = ""; foreach (string l in proxies) { string neww = l.Replace(" ", string.Empty).Replace("\n", string.Empty); pList.Add(neww); prList += neww + Environment.NewLine; } int threads = 0; foreach (string n in pList) { if (n == "Select A Proxy...") { continue; } var s = Regex.Split(n, "\r\n?|\n")[0]; string address = s.Split(':')[0]; string pport = ""; try { pport = s.Split(':')[1]; } catch { } if (threads > Globals.iMaxThreads) { delay(Globals.iThreadDelay); threads = 0; } try { ProxyTestThread ptt = new ProxyTestThread(address, Int32.Parse(pport)); Thread t = new Thread(ptt.Run); t.Start(); } catch { } threads += 1; } delay(5000); } }