コード例 #1
0
        public static void LoadHtmlFile(
            System.IO.Stream stream,
            DomDocument document,
            string baseUrl)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            HTMLDocument htmlDoc = new HTMLDocument();

            htmlDoc.Load(stream);
            htmlDoc.BaseURL = baseUrl;
            HtmlLoader loader = new HtmlLoader();

            loader.Load(htmlDoc, document);
            document.AfterLoad(FileFormat.Html);
        }