I found this code online quite a while ago and I use it to check for an internet connection. Understanding precisely what is going on eludes me. Checking the documentation is where I will head next, but I'm in search of succinct, candid insight from all of you on here I've grown to trust and respect over the last five years.
vb.net Code:
' Integer value if Internet connection is currently configured Public Const InternetConnectionIsConfigured As Integer = &H40S ''' <summary> ''' Found this on the internet, checks for an internet connection ''' </summary> ''' <param name="lpdwFlags">I have no idea</param> ''' <param name="dwReserved">No clue</param> ''' <returns></returns> ''' <remarks></remarks> Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Integer, ByVal dwReserved As Integer) As Integer