예제 #1
0
        public void AddUrlQueue(string strUrl)
        {
            CrawlerItem cI = new CrawlerItem();

            cI.strUrl   = strUrl;
            cI.strRefer = strUrl;

            m_Stack.Push(cI);
        }
예제 #2
0
        public PageResult ProcessQueue(Encoding encoding)
        {
            PageResult pr = new PageResult();

            if (m_Stack.Count == 0)
            {
                return(null);
            }
            else
            {
                CrawlerItem cI = m_Stack.Pop();


                string strContent = GetPageByHttpWebRequest(cI.strUrl, encoding);

                pr.strPageContent = strContent;
                pr.strVisitUrl    = cI.strUrl;
                return(pr);
            }
        }