예제 #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     = 1;
            worker.session_id = m_sessionId;
            worker.rootPath   = rootPath;
            worker.start();
            //}

            // now wait to be done

            m_done.WaitBegin();
            m_finished = m_done.WaitDone(m_outputPath);
        }
예제 #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();
        }
예제 #3
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 = 1;
                worker.session_id=m_sessionId;
                worker.start();
            //}

            // now wait to be done

            m_done.WaitBegin();
            m_finished=m_done.WaitDone(m_outputPath);
        }
예제 #4
0
파일: Spider.cs 프로젝트: hamoji/sprajax
		/// <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();			
		}