在VB中怎么链接到一个HTML页面上?

解决方案 »

  1.   

    '用户点击label时将跳转到html页面
    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 label1_Click()
        Dim a As Long
        a = ShellExecute(0, "open", "www.csdn.net", vbNull, vbNull, 0)
    End Sub
      

  2.   

    方法1:
    首先定义
    Public 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 homepage_Click()
         Call ShellExecute(hwnd, "Open", "http://www.12369.gov.cn", "", App.Path, 1)
    End Sub
      

  3.   

    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 label1_Click()
        Dim a As Long
        a = ShellExecute(0, "open", "www.csdn.net", vbNull, vbNull, 0)
    End Sub或者使用WINBROWSER
      

  4.   

    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 LongShellExecute(hwnd, "Open", "http://www.www.www", "", "", 1)
      

  5.   

    需要引入 MICROSOFT INTERNET CONTROL
    Dim ii As InternetExplorer
    Set ii = GetObject("", "INTERNETEXPLORER.APPLICATION")
    ii.Navigate "www.163.com", navNoReadFromCache
    ii.Visible = True
      

  6.   

    Public 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
    Public Addess As String 'addess变量为网址Private Sub cmdgo_Click() 'text1中是你的网址如:www.163.com
        Addess = text1.Text
        Call link '调用link子程序,进行超级链接
    End SubPublic Sub link() '网址连接
      linkaddess = ShellExecute(0&, vbNullString, Addess, vbNullString, vbNullString, vbMinimizedFocus)
    End Sub
      

  7.   

    对不起大家,我现在已经没分了,但还有问题要问大家,在VB中怎么检测是否连通INTERNET?谢谢大家了。