示例#1
0
        private void ProcessLink(string link)
        {
            Uri url;

            try
            {
                url = new Uri(m_uri, link);
            }
            catch
            {
                return;
            }
            if (!url.Scheme.ToLower().Equals("http") &&
                !url.Scheme.ToLower().Equals("https"))
            {
                return;
            }
            if (!url.Host.ToLower().Equals(m_uri.Host.ToLower()))
            {
                m_spider.ReportTo.SetLastUrl(url.ToString());
                return;
            }
            // The following line we add 'cos we want to show external links as well as spidered links...
            else
            {
                m_spider.ReportTo.WriteExcluded(url.ToString());
            }
            m_spider.addURI(url);
        }