没引用对应的组件。
Microsoft.mshtml.DLL
family as water
现在这是固定的。谢谢。
现在我有一个新的问题。
出于某种原因,永远不会被调用回调方法。
必须从这个代码是缺了点什么:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
webbrowser1 = new WebBrowser();
webbrowser1.LoadCompleted +=webbrowser1_LoadCompleted;
webbrowser1.Navigate(new Uri("http://www.google.com"));
}
这基本上是我的代码是什么。
也许回调方法是错误的:
void webbrowser1_LoadCompleted(object sender, NavigationEventArgs e)
{
HTMLDocument doc = (mshtml.HTMLDocument)webbrowser1.Document;
String sResult = GetContent(doc.toString(), iCount);
iCount++;
}
我已经把这种方法和代码中的断点不停止这种方法。