帖错了,应该是:
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
Public Function IsConnected() As Boolean
If InternetGetConnectedState(0&, 0&) = 1 Then
IsConnected = True
Else
IsConnected = False
End If
End Function