Not a Member Yet,
Click here to Register
How do you like the new design?
It's cool, great job
[tally: 70%] 70%
It's okay
[tally: 20%] 20%
Its OK but I liked the old layout better
[tally: 0%] 0%
Please bring the old one back
[tally: 10%] 10%

votes: 10

ID: 358
Viewed: 2278
Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Trigeminal Software
Demo: Sorry, no demo

User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

' Connect
' Telling whether or not you are connected
' to the Internet
' (c) 1998-99 Trigeminal Software, Inc. All Rights Reserved

Highlight all by clicking in box
'Option Compare Text
Option Explicit

Private Const INTERNET_FLAG_RELOAD = &H80000000
Private Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000

Private Declare Function InternetOpen _
Lib "wininet.dll" Alias "InternetOpenW" _
(ByVal lpszAgent As Long, _
ByVal dwAccessType As Long, _
ByVal lpszProxyName As Long, _
ByVal lpszProxyBypass As Long, _
ByVal dwFlags As Long) As Long

Private Declare Function InternetOpenUrl _
Lib "wininet.dll" Alias "InternetOpenUrlW" _
(ByVal hInet As Long, _
ByVal lpszUrl As Long, _
ByVal lpszHeaders As Long, _
ByVal dwHeadersLength As Long, _
ByVal dwFlags As Long, _
ByVal dwContext As Long) As Long

Private Declare Function InternetCloseHandle _
Lib "wininet.dll" (ByVal hInet As Long) As Long

Highlight All
Public Function TestConnection(stSite As String) As Boolean
Dim hInet As Long
Dim hUrl As Long
Dim lFlags As Long
Dim url As Variant

hInet = InternetOpen(StrPtr(App.Title), INTERNET_OPEN_TYPE_PRECONFIG, 0&, 0&, 0&)
If hInet Then
hUrl = InternetOpenUrl(hInet, StrPtr(stSite), 0&, 0, lFlags, 0)
If hUrl Then
TestConnection = True
Call InternetCloseHandle(hUrl)
hUrl = 0
End If
End If
Call InternetCloseHandle(hInet)
hInet = 0
End Function;

No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.

Replying to a Comment...

Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2018 All Rights Reserved. Conditions