引用:http://topic.csdn.net/t/20040513/12/3062643.html
Private Const FLAG_ICC_FORCE_CONNECTION = &H1
Private Declare Function InternetCheckConnection Lib "wininet.dll " Alias "InternetCheckConnectionA " (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Boolean
If InternetCheckConnection( "http://www.csdn.net ", FLAG_ICC_FORCE_CONNECTION, 0&) Then
...
end if