Пример #1
0
 /// <summary>
 /// 构造函数,此类无需使用者自己构造,也无需使用者调用
 /// </summary>
 /// <param name="core"></param>
 public UrlThread(CrawlerCore core)
 {
     this.core = core;
     if (core == null)
     {
         throw new WebException("Crawler的子类没有被初始化");
     }
     this.uriQueue = new Queue <Uri>();
 }
Пример #2
0
 public static void run(CrawlerCore c)
 {
     if (c == null)
     {
         return;
     }
     else if (c.depth == 0 || c.ThreadNum == 0)
     {
         return;
     }
     else
     {
         c.threads.start(c.ThreadNum);
     }
 }