Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 private static void V2()
 {
     IEnumerable <ProxyInfo> pis = ProxyInfoParser.ReadConfig("F:/dev/a.xml");
 }