Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detemining a computer's
Message
De
11/05/2001 11:44:14
Jorge Haro
Independent Consultant
Juarez, Mexique
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Detemining a computer's
Divers
Thread ID:
00506227
Message ID:
00506227
Vues:
52
... as opposed to the automatically assigned private network IP address of a cable modem, I wrote this program that uses a script ( in Pearl I believe, it's not mine ) somewhere in the internet, and it works fine for now, the problem is that it relies on that script being there.
#DEFINE READYSTATE_COMPLETE 4
#DEFINE MAX_TIME 30

local loIE 		&& Internet Explorer object
local lcInnerText 	&& Text of the webpage
local lcIPAdd 		&& IP Address as a string
local lnStartedAt	&& Seconds when started loading
local lnWaiting  	&& Seconds waiting for the document to load
local lcRetVal		&& Return Value

loIE = createobject( 'internetexplorer.application' )

lnStarted = SECONDS()

loIE.navigate( 'http://www.internet-help.net/cgi-bin/ip-address.pl' )


do while loIE.Readystate <> READYSTATE_COMPLETE or lnWaiting >= MAX_TIME

	lnWaiting = Seconds() - lnStarted

enddo

if lnWaiting < MAX_TIME

	lcInnerText = loIE.Document.Body.InnerText

	lcIPAdd = allt(substr(lcInnerText , at( ':' , lcInnerText , 2 ) + 1 ) )

	lcRetVal = lcIPAdd

else

	lcRetVal = 'Timeout'

endif

?lcRetVal
TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform