by Manish Kataria (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 13th September 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Check DialUp connection & connection mode
API Declarations
Private Declare Function InternetDial Lib "wininet.dll" (ByVal hWnd As Long, ByVal sConnectoid As String, ByVal dwFlags As Long, lpdwConnection As Long, ByVal dwReserved As Long) As Long
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 Sub cmdDisconnect_Click()
lngresult = InternetHangUp(ConnectionNumber, 0)
End Sub
Private Sub Command1_Click()
lngresult = InternetDial(0, "test", 0, ConnectionNumber, 0&)
End Sub
Private Sub Command2_Click()
Dim sConnType As String * 255
Dim Ret As Long
Ret = InternetGetConnectedStateEx(Ret, sConnType, 254, 0)
If Ret = 1 Then
MsgBox "You are connected to Internet via a " & sConnType, vbInformation
Else
MsgBox "You are not connected to internet", vbInformation
'Command1_Click
End If
End Sub