打开没有Webbrowser或Inet控件vb6的URL

ast*_*ter 0 browser vb6 url web msinet

有没有办法在不使用Webbrowser或MSInet组件的情况下在VB6应用程序中打开URL?谢谢

Akh*_*ran 7

如果您只想在浏览器窗口中打开URL,请使用ShellExecute:http://support.microsoft.com/kb/224816

Private Declare Function ShellExecute _
                            Lib "shell32.dll" _
                            Alias "ShellExecuteA"( _
                            ByVal hwnd As Long, _
                            ByVal lpOperation As String, _
                            ByVal lpFile As String, _
                            ByVal lpParameters As String, _
                            ByVal lpDirectory As String, _
                            ByVal nShowCmd As Long) _
                            As Long

Private Sub Command1_Click()
   Dim r As Long
   r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1)
End Sub
Run Code Online (Sandbox Code Playgroud)

这将在默认浏览器中打开URL.

否则,如果您需要在应用程序内显示网页,请使用WebBrowser控件.