private async void btnCreateProxies_Click(object sender, EventArgs e) { rtxtLog.Text += "\nWorking..."; var checkedButton = grpLocation.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked); for (int i = 1; i < 6; i++) { rtxtLog.Text += "\nAttempting to create proxy " + i.ToString() + " of 5."; ProxyTask proxyTask = new ProxyTask(txtAPIKey.Text, checkedButton.Tag.ToString()); await proxyTask.Start(); tasks.Add(proxyTask); } rtxtLog.Text += "\nAll proxies have been created. They should be ready to go in a few minutes."; try { AddIPs(); } catch { rtxtLog.Text += "\nAn error occurred while trying to retrieve servers. Please double check your API key."; } }
public async void AddIPs() { ProxyTask proxyTask = new ProxyTask(txtAPIKey.Text, ""); await proxyTask.GetIPs(); foreach (string IP in proxyTask.IPList) { rtxtLog.Text += "\n" + IP + ":3128:valyr:snivynGOD"; } rtxtLog.Text += "\nAll proxies loaded."; }