MyDownloader.Spider.Parsers.Html.HtmlParser.GetImages C# (CSharp) Method

GetImages() public method

public GetImages ( string baseUri ) : IEnumerable
baseUri string
return IEnumerable
        public IEnumerable<Uri> GetImages(string baseUri)
        {
            return GetEnumerator(RegExFindImg, baseUri, this.htmlData);
        }

Usage Example

Exemplo n.º 1
0
        private void LoadData()
        {
            nextResources.Clear();

            if (download.RemoteFileInfo.MimeType.IndexOf("text/html", StringComparison.OrdinalIgnoreCase) < 0)
            {
                return;
            }

            try
            {
                DownloadManager.Instance.OnBeginAddBatchDownloads();

                using (Stream htmlStream = File.OpenRead(download.LocalFile))
                {
                    using (HtmlParser parser = new HtmlParser(htmlStream))
                    {
                        AddUrls(parser.GetHrefs(context.BaseLocation), UrlType.Href);
                        AddUrls(parser.GetImages(context.BaseLocation), UrlType.Img);
                        AddUrls(parser.GetFrames(context.BaseLocation), UrlType.Frame);
                        AddUrls(parser.GetIFrames(context.BaseLocation), UrlType.IFrame);
                    }
                }
            }
            finally
            {
                DownloadManager.Instance.OnEndAddBatchDownloads();
            }
        }