我正在将一个本地HTML文件加载到IE中,并希望收到一个DocumentComplete事件。它永远不会被解雇。我也尝试过NavigateComplete和ProgressChange,但它们也没有被解雇。这是代码:
public void OnDocumentCompleted(object pdisp, ref object url)
{
Console.WriteLine("DocumentCompleted fired on url {0}!", url);
}
var IE = new InternetExplorer();
object Empty = 0;
IE.NavigateComplete2 += new DWebBrowserEvents2_NavigateComplete2EventHandler(e.OnNavigateComplete2);
IE.DocumentComplete += new DWebBrowserEvents2_DocumentCompleteEventHandler(e.OnDocumentCompleted);
IE.ProgressChange += new DWebBrowserEvents2_ProgressChangeEventHandler(e.OnProgressChange);
var uri = new Uri("file://c:/iframeExample.html");
IE.Navigate(uri.AbsolutePath);
IE.Quit();
如果我正在浏览网页上的某个页面,我会收到所有活动。那么,为什么他们不被解雇本地页面呢?