WebBrowser 让其不跳转到ie

private void webBrowser1_NewWindow(object sender, CancelEventArgs e)
{
e.Cancel = true;
try
{
string url = this.webBrowser1.Document.ActiveElement.GetAttribute("href");

this.webBrowser1.Url = new Uri(url);
}
catch
{
}
}

你可能感兴趣的:(WebBrowser)