添加Navigating事件
private void lisUrl_Navigating(object sender, NavigatingCancelEventArgs e)
{
try
{
FieldInfo fi = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic);
if (fi != null)
{
object browser = fi.GetValue(sender as WebBrowser);
if (browser != null)
browser.GetType().InvokeMember("Silent", BindingFlags.SetProperty, null, browser, new object[] { true });
}
}
catch (Exception ex)
{
}
}