我用的不是拔号上网,
是局域网上网.如果连接上,则发出一提示......最好不用timer

解决方案 »

  1.   

    Option Explicit
    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 Command1_Click()
        Command1.Enabled = False
        txStatus.Text = ""    If Len(Inet1.OpenURL("http://www.ourfly.com")) <> 0 Then
            txStatus.Text = "已经与 Internet 连接"
        Else
            txStatus.Text = "尚未与 Internet 连接"
            ShellExecute 0&, vbNullString, "www.google.com", vbNullString, vbNullString, 1
        End If
        
        Command1.Enabled = True
    End Sub