Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Last active June 29, 2017 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndthanh/c518e70c7827a15f9eea8b0c029548c4 to your computer and use it in GitHub Desktop.
Save ndthanh/c518e70c7827a15f9eea8b0c029548c4 to your computer and use it in GitHub Desktop.
Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long
'Testing for internet connection
Public Function IsInternetConnected() As Boolean
IsInternetConnected = InternetGetConnectedStateEx(0, "", 254, 0)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment