2010-04-20 23 views

回答

9

的的HTMLDocument是已經被WebBrowser控件加載的文件的一個實例。因此沒有ctor。

Html Agility Pack是迄今爲止我已經習慣了這種目的

從CodePlex上維基

HtmlDocument doc = new HtmlDocument(); 
doc.Load("file.htm"); 
foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href]")) 
{ 
    HtmlAttribute att = link["href"]; 
    att.Value = FixLink(att); 
} 
doc.Save("file.htm"); 

的例子顯示了文件的加載一個例子最好的圖書館,但也有讓你過載加載一個字符串或一個流。  

+0

太棒了,謝謝! – Matt 2010-04-20 04:41:32

相關問題