Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verifying connection to the internet from an app.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Titre:
Verifying connection to the internet from an app.
Divers
Thread ID:
00924683
Message ID:
00924683
Vues:
43
Right now I am using a the code at the bottom to make sure a connection exists.

So basically I run the HTTPPing() if I can't ping I guess they are using a dialup that needs to be dialed so I call InternetDial() then if that returns .t. I test the HTTPPing() again.

Is that the way most people do this? Is there a better / faster way to see if I connection exists?

TIA,

Ron
*!* Make sure the user is logged on to the internet
WAIT WINDOW "Verifying an Internet connection is available..." NOWAIT NOCLEAR
IF !oInternet.HTTPPing(10, "www.server.com")
	WAIT WINDOW "Attempting to connect to the Internet" NOWAIT NOCLEAR
	
	*!* Connect unless we are already connected
	IF oInternet.InternetDial() OR GoApp.Connected_Via_Dialup
		WAIT WINDOW "Verifying Internet connection succeeded..." NOWAIT NOCLEAR
		IF !oInternet.HTTPPing(10, "www.server.com")
			WAIT CLEAR
			GoApp.MsgBox("                          Unable To Connect to the internet." + CHR(13) + CHR(10) + CHR(13) + CHR(10) +; 
						[You must be connected to the Internet in order to use the "Super Charger" feature.], 64)
			GoApp.Connected_Via_Dialup = .F.
			RETURN .F.
		ELSE
			GoApp.Connected_Via_Dialup = .T.
		ENDIF
	ELSE
		WAIT CLEAR
		GoApp.MsgBox("                               Operation canceled by user." + CHR(13) + CHR(10) + CHR(13) + CHR(10) +; 
					[You must be connected to the Internet in order to use the "Super Charger" feature.], 64)
		RETURN .F.
	ENDIF
ENDIF
Ronald L. Thorp
http://www.Fox-Pros.com
Fox-Pros, Inc.
Office 407-498-0100
Répondre
Fil
Voir

Click here to load this message in the networking platform