コード例 #1
0
ファイル: Program.cs プロジェクト: rburda82/proxysearcher
        static void Main(string[] args)
        {
            var url = "http://proxysearcher.sourceforge.net/Proxy%20List.php?type=http&filtered=true&limit=1000";
            ISearchEngine searchEngine = new ParallelSearchEngine(new UrlListSearchEngine(url),
                                                                  new GoogleSearchEngine(40, "http proxy list", null));

            IProxyChecker checker =
                new ProxyCheckerByUrl<HttpProxyDetailsProvider>("http://wikipedia.org/", 0.9, 100);
            IHttpDownloaderContainer httpDownloaderContainer =
                new HttpDownloaderContainer<HttpClientHandler, ProgressMessageHandler>();

            Application application = new Application(searchEngine, checker, httpDownloaderContainer);

            application.ProxyAlive += application_ProxyAlive;
            application.OnError += exception => Console.WriteLine(exception.Message);

            application.SearchAsync().GetAwaiter().GetResult();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var           url          = "http://proxysearcher.sourceforge.net/Proxy%20List.php?type=http&filtered=true&limit=1000";
            ISearchEngine searchEngine = new ParallelSearchEngine(new UrlListSearchEngine(url),
                                                                  new GoogleSearchEngine(40, "http proxy list", null));

            IProxyChecker checker =
                new ProxyCheckerByUrl <HttpProxyDetailsProvider>("http://wikipedia.org/", 0.9, 100);
            IHttpDownloaderContainer httpDownloaderContainer =
                new HttpDownloaderContainer <HttpClientHandler, ProgressMessageHandler>();

            Application application = new Application(searchEngine, checker, httpDownloaderContainer);

            application.ProxyAlive += application_ProxyAlive;
            application.OnError    += exception => Console.WriteLine(exception.Message);

            application.SearchAsync().GetAwaiter().GetResult();
        }