我到处寻找这个!我需要做的就是:
If the webbrowser's url = "http://www.example.com" then
CheckBox1.CheckState = CheckState.Checked
end if
感谢。
....后来我找到了答案: 我终于找到了答案:
If WebBrowser1.Url.ToString = "http://www.example.com" Then
do something
End If
这必须在webbrowser文档中完成sub:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
总而言之,答案是:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If WebBrowser1.Url.ToString = "http://www.example.com" Then
do something
End If
end sub