Esempio n. 1
0
        /// <summary>
        /// Start the spider.
        /// </summary>
        /// <param name="baseURI">The base URI to spider</param>
        /// <param name="threads">The number of threads to use</param>
        public void Start(Uri baseURI, int threads)
        {
            // init the spider
            m_quit = false;

            m_base = baseURI;
            addURI(m_base);
            m_startTime = System.DateTime.Now.Ticks;;
            m_done.Reset();

            // startup the threads

            for (int i = 1; i < threads; i++)
            {
                DocumentWorker worker = new DocumentWorker(this);
                worker.Number = i;
                worker.start();
            }

            // now wait to be done

            m_done.WaitBegin();
            m_done.WaitDone();
        }
Esempio n. 2
0
		/// <summary>
		/// Start the spider.
		/// </summary>
		/// <param name="baseURI">The base URI to spider</param>
		/// <param name="threads">The number of threads to use</param>
		public void Start(Uri baseURI,int threads)
		{
			// init the spider
			m_quit = false;

			m_base = baseURI;
			addURI(m_base);
			m_startTime = System.DateTime.Now.Ticks;;
			m_done.Reset();
		
			// startup the threads

			for(int i=1;i<threads;i++)
			{				
				DocumentWorker worker = new DocumentWorker(this);
				worker.Number = i;
				worker.start();
			}

			// now wait to be done

			m_done.WaitBegin();
			m_done.WaitDone();			
		}