0
嗨我寫了一段代碼,它允許程序從文本框中獲取郵編,然後將其輸入到用戶的Bing中。當我使用www.bing.com時,這種方法非常好,但如果我使用http://www.bing.com/maps/?mkt=en-gb,以便郵政編碼直接輸入到Bing地圖中,那麼它會崩潰。我已經包含了一段與標準Bing搜索結合使用的代碼副本,但希望能讓程序直接搜索Bing地圖而不會造成程序崩潰。必應地圖與VB
謝謝
公共類Form1中
Dim Automate As Boolean
Private Sub BTNMAPP_Click(sender As Object, e As EventArgs) Handles BTNMAPP.Click
Automate = True
BingBrowserWindow.Navigate("https://www.bing.com")
End Sub
Private Sub BingBrowserWindow_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles BingBrowserWindow.DocumentCompleted
If Automate = True Then Automate = False Else Exit Sub
Dim txt As HtmlElement = BingBrowserWindow.Document.GetElementById("q")
Dim btn As HtmlElement = BingBrowserWindow.Document.GetElementById("go")
txt.SetAttribute("value", PostcodeTextBox.Text)
btn.InvokeMember("click")
End Sub