Check for active Internet connection

topic: 

The InternetCheckConnection function

can be used to check for an active connection to the internet. It requires an URL to a fast and reliable web site as the first parameter.

$SAMPLECODE$

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14

#DEFINE  FLAG_ICC_FORCE_CONNECTION 1

DECLARE Long InternetCheckConnection IN Wininet.dll String Url, Long dwFlags, Long Reserved

* Fast and reliable web site
lcUrl = "http://www.google.com"
IF InternetCheckConnection(lcUrl, FLAG_ICC_FORCE_CONNECTION, 0) <> 0
	? "Connection is available"
ELSE
	? "No Connection"
ENDIF

Comments

Great code, very useful, thanks a lot!

I have try it and works perfectly under Windows XP, but it does not seem to work under Vista.

hello sir sergey

i m a student of 12th class .

i want to a programme of 'INTERNET SPEED METER' MAKE from vfp ....!

which is works with dial up and broadband version .

warm regards.