MyDownloader.Spider.Parsers.Html.HtmlParser.GetHrefs C# (CSharp) Метод

GetHrefs() публичный Метод

public GetHrefs ( string baseUri ) : IEnumerable
baseUri string
Результат IEnumerable
        public IEnumerable<Uri> GetHrefs(string baseUri)
        {
            return GetEnumerator(RegExFindHref, baseUri, this.htmlData);
        }

Usage Example

Пример #1
0
        private void FillListFromHtmlFile(List<ResourceLocation> urls)
        {
            using (Stream htmlStream = File.OpenRead(txtFileName.Text))
            {
                using (HtmlParser parser = new HtmlParser(htmlStream))
                {
                    IEnumerator<Uri> enumUri = parser.GetHrefs(this.location1.ResourceLocation.URL).GetEnumerator();

                    while (enumUri.MoveNext())
                    {
                        ResourceLocation newRl = location1.ResourceLocation;
                        newRl.URL = enumUri.Current.OriginalString;
                        urls.Add(newRl);
                    }
                }
            }
        }
All Usage Examples Of MyDownloader.Spider.Parsers.Html.HtmlParser::GetHrefs