Пример #1
0
 public static void SiteGrabber()
 {
     while (true)
     {
         using (_client = new WebClient())
         {
             var db = new DataProviderProxy();
             _client.Encoding = Encoding.UTF8;
             string resault =
                 _client.DownloadString(
                     @"http://go.mail.ru/search?q=+"":8080"" +"":3128"" +"":80""&num=10&rch=e&sf=" + _page*10);
             _regex = new Regex(_patternSait);
             _matchCol = _regex.Matches(resault);
             foreach (Match match in _matchCol)
             {
                 Console.WriteLine("найден: " + match.Groups[2].Value);
                 db.InsertSite(match.Groups[2].Value);
             }
             _page++;
         }
         Thread.Sleep(1000*60*3);
     }
 }