Hello,
This is the code
VB Code:
Private Sub cmdgetstate_Click() Dim lres As Long lres = InternetGetConnectedState(lret, 0&) If (lret And INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED Then MsgBox ("This system has a valid internet connection ") End If If (lret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then MsgBox ("This system is connected to internet through LAN") End If If (lret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then MsgBox ("This system is connected to internet through modem") End If If (lret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE Then MsgBox ("This system is presently offline") End If If (lret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then MsgBox ("This system is connected to internet through proxy") End If If (lret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then MsgBox ("This system has RAS installed ") End If End Sub
Message box is being displayed only for INTERNET_CONNECTION_LAN and INTERNET_RAS_INSTALLED.
How come the function detecting the valid internet connection says "NO" , but the function detecting connection through lan says "YES"?
This being the case , how do I check to see if a user of my program is connected to the internet?
Thank you.




Reply With Quote