VB Snippet - Internet Status
VB Code:
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Private Const FLAG_ICC_FORCE_CONNECTION = &H1
Private Sub Form_Load()
If InternetCheckConnection("http://www.galahtech.com", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then
MsgBox "No internet connection detected...", vbInformation
Else
MsgBox "Internet connection detected...", vbInformation
End If
End Sub
Re: VB Snippet - Internet Status
Quote:
Originally Posted by James Stanich
VB Code:
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Private Const FLAG_ICC_FORCE_CONNECTION = &H1
Private Sub Form_Load()
If InternetCheckConnection("http://www.galahtech.com", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then
MsgBox "No internet connection detected...", vbInformation
Else
MsgBox "Internet connection detected...", vbInformation
End If
End Sub
Will the above code work if user is connected via LAN?
Thanx, Shiraz
Re: VB Snippet - Internet Status
It should. If there is an active internet connection then a connection to the site will be made.