Shell "explorer.exe http://www.baisoft.net", vbNormalFocus
我知道用它可以用IE打开,但是我想的是用计算机默认的浏览器我在做软件的时候要打一个label文字广告,写个网址,点一下就能打开网站等ing....

解决方案 »

  1.   


    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 LongPrivate Sub Form_Load()
        ShellExecute hwnd, "open", "http://www.baidu.com", "", "", 1
    End Sub
      

  2.   


    为什么在form_load里就行,写在按钮里就不行呢?挺怪!
      

  3.   


    shell "cmd /c explorer http://www.google.com.hk 
      

  4.   

    随便写下的,你写在sub main里都可以。
      

  5.   

    Explorer.exe 本身就是以默认的方式打开文件的Option Explicit
    Private Sub Command1_Click()
       Dim ie As Object
       Set ie = CreateObject("INTERNETEXPLORER.APPLICATION")
       ie.Visible = True
       ie.Navigate "http://CBM666.NET/"
    End Sub