我在href找到了错误,所以请帮助我
Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
Dim thiselement As HtmlElement = WebBrowser1.Document.ActiveElement
Dim targeturl As String = thiselement.GetAttribute("href")
e.Cancel = True
Dim window As New Form1
window.Show()
window.WebBrowser1.Navigate(targeturl)
End Sub
在“href”处,我发现对象引用未设置为对象瞬间之类的错误。我的代码在 vb.net 2010 中。