有人可以告诉我为什么 DocumentCompleted 事件发生 3 次???
我怎么知道该文件真的已经被下载了?
(我用一些页面来测试有很多 jQuery。)
谢谢!
var webBrowser1 = new WebBrowser
{
Padding = new Padding(0),
Margin = new Padding(0),
Dock = DockStyle.Fill,
Url = url,
TabStop = false,
ScriptErrorsSuppressed = true,
IsWebBrowserContextMenuEnabled = false
};
webBrowser1.Navigated += (d1,d2) =>
{
Debug.WriteLine("Navigated " + DateTime.Now.TimeOfDay.ToString());
};
webBrowser1.DocumentCompleted += (d1, d2) =>
{
Debug.WriteLine("DocumentCompleted " + DateTime.Now.TimeOfDay.ToString());
};
form.Controls.Add(webBrowser1);
form.Show();
日志:
导航09:40:40.1807403导航09:40:44.7270004 documentCompleted 09:40:44.7300005导航09:40:40:46.5791063 documentCompemed Commpleted 09:40:40:40:40:46.5821065 Naimbiged 09:40.40.40.40.11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111卡库蒂克