VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Automatic Internet Dialup

Bradley Liang  (6 Submissions)   Internet/HTML   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Most code snippets simply show you how to display
a connect dialog. The problem with this is that
it doesn't force a dial-up and won't alert you
when a connection is established.

This code solves those problems by using Internet
Explorer's own 'automatic dial-up' settings
(Control Panel >> Internet options >> Connections).

It utilises two little-known API calls that can
automatically connect / disconnect from the
default connection.
Note: If the 'Never Dial a Connection' option is
selected, this code will not be able to connect.

I came across this API awhile ago when my friend
suggested a forced dialup and gave me this tip.
It's actually pretty helpful.

API Declarations
Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
Private Declare Function InternetAutodial Lib "wininet.dll" _
(ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Private Declare Function InternetAutodialHangup Lib "wininet.dll" _
(ByVal dwReserved As Long) As Long

Rate Automatic Internet Dialup (17(17 Vote))
Automatic Internet Dialup.bas

Automatic Internet Dialup Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters