|
-
Oct 20th, 2002, 06:02 PM
#1
Thread Starter
Addicted Member
Will you guys test this? (Internet Connection)
Hey everyone,
I found the following piece of code somewhere, and was just
wondering if you guys (and girls) would check it out to see if
it works OK for you.
I need a good, reliable code to check to see if the computer is
connected to the Internet. It needs to work with cable modems,
dial-up modems, and networks.
I'm pretty sure this will work fine, but I sure would appreciate it
if you would check it out.
Thanks in advance,
Ron
*********************************************
*********************************************
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 Long
Private Sub Form_Load()
If InternetCheckConnection("http://www.yahoo.com", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then
MsgBox "Connection failed!", vbInformation
Else
MsgBox "Connection succeeded!", vbInformation
End If
End Sub
*********************************************
*********************************************
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|