VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



check internet connection

by Rakesh R. Shetty (1 Submission)
Category: Internet/HTML
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

checks the internet connection

Assumes
I have tested this code on windows 2000 and XP. Dont know whether it works for windows 9x.

Rate check internet connection

Private Const FLAG_ICC_FORCE_CONNECTION = 1
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Boolean
Private Sub Command1_Click()
Dim abc As String
 abc = InternetCheckConnection("http://www.microsoft.com", FLAG_ICC_FORCE_CONNECTION, 0)
 If abc = "True" Then
  MsgBox "Connected to the internet."
 Else
  MsgBox "Not connected to the internet."
 End If
End Sub

Download this snippet    Add to My Saved Code

check internet connection Comments

No comments have been posted about check internet connection. Why not be the first to post a comment about check internet connection.

Post your comment

Subject:
Message:
0/1000 characters