I want to search the code your computer with an internet connection, note: not the case on or off the network card
Printable View
I want to search the code your computer with an internet connection, note: not the case on or off the network card
TryCode:Option Explicit
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
Private strConnType As String * 255
End Sub
Private Sub Form_Load()
Dim Ret As Long
Ret = InternetGetConnectedStateEx(Ret, strConnType, 254, 0)
If Ret = 1 Then
MsgBox "You are connected to Internet via a " & strConnType, vbInformation
Else
MsgBox "You are not connected to internet", vbInformation
End If
End Sub