1
我就打开一个网站,用户填写并提交表单WPF应用程序使用WebBrowser Control
。提交后,它重定向到另一个页面后10秒,www.google.com
例如。检测特定网站的web浏览器我浏览到
有没有办法当WebBrowser
开辟www.google.com
检测?
我就打开一个网站,用户填写并提交表单WPF应用程序使用WebBrowser Control
。提交后,它重定向到另一个页面后10秒,www.google.com
例如。检测特定网站的web浏览器我浏览到
有没有办法当WebBrowser
开辟www.google.com
检测?
当web浏览器中webbrowser_LoadCompleted
事件已经打开了你的网站的名称您可以检测,试试这个:
void webbrowser_LoadCompleted(object sender, NavigationEventArgs e)
{
mshtml.HTMLDocument doc =(mshtml.HTMLDocument) s.Document;
if (doc.parentWindow.window.location.host == "www.google.com")
{
MessageBox.Show("you navigated to google");
}
}
您是否尝试过使用'DocumentCompleted'事件? –
或者,你的意思是“导航中”事件? http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.navigated.aspx – Jasper
@Jasper,它可能需要这些事件的组合。该'Navigated'事件可以重定向期间火,但如果想OP时'www.google.com'已经加载知道,他们将需要消耗'DocumentCompleted'事件。 –