我已经构建了自己的浏览器 9see 附加代码)但是我想修改代码,以便 textbox1 在开始时读取一个 txt 文件并使用该文本文件的内容导航到与该文本中的文本具有相同值的 URL文件。所有这一切都应该在 Web 浏览器表单启动时发生。
文本文件内容的示例是http://www.testsite.com
代码如下:
#Region "Webbrowser navigation"
Private Sub Go()
WebBrowser1.Navigate(TextBox1.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Go()
End Sub
Private Sub TextBox1_keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
Go()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.GoBack()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.GoForward()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Stop()
End Sub
#End Region
我怎样才能最好地做到这一点?