private void DoValidateCompleted(object sender, RunWorkerCompletedEventArgs e) { List <ProxyInfo> pis = proxyManager.GoodProxiesQueue.ToList(); ProxyInfo current = selectiveProxyGuide.CurrentProxyInfo; if (current != null) { pis.Insert(0, current); } ProxyInfoParser.WriteConfig(proxyInfoPath, pis); }
private static void V1() { List <ProxyInfo> pis = new List <ProxyInfo>(); pis.Add(new ProxyInfo { HttpProxy = new WebProxy("127.0.0.1:8888"), RTT = 45 }); ProxyInfoParser.WriteConfig("F:/dev/a.xml", pis); }
public bool LoadConfigs() { bool success = true; if (File.Exists(proxyInfoPath)) { try { IEnumerable <ProxyInfo> pis = ProxyInfoParser.ReadConfig(proxyInfoPath); proxyManager.LoadProxies(pis); }catch { success = false; } } if (File.Exists(proxyValidateConditionPath)) { try { IEnumerable <ProxyValidateCondition> pvcs = ProxyValidateConditionParser.ReadConfig(proxyValidateConditionPath); proxyManager.ProxyValidator.LoadProxyValidations(pvcs); } catch { success = false; } } if (File.Exists(proxyProviderPath)) { try { IEnumerable <AbstractProxyProvider> pvcs = ProxyProviderParser.ReadConfig(proxyProviderPath); proxyManager.LoadProxyProviders(pvcs); } catch { success = false; } } success &= LoadURLPatterns(); return(success); }
private static void V2() { IEnumerable <ProxyInfo> pis = ProxyInfoParser.ReadConfig("F:/dev/a.xml"); }