Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parce the IP Address
Message
 
 
À
07/06/2004 16:20:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00910906
Message ID:
00910928
Vues:
24
Doyle,
Tryy
? STREXTRACT(ox.Document.Body.InnerText, "is ", CHR(13))<.pre> Or you can use another web site that return IP w/o extra text. <pre>...
ox.navigate2("http://www.whatismyip.org")
? ox.Document.Body.InnerText
>
>I'm looking for an easier (or more elegant) way to parce the IP Address
>
>
>
>ox = Createobject('internetexplorer.application')
>ox.navigate2("http://www.whatismyip.com/")
>Do While ox.busy
>Enddo
>If Type("ox") = "O"
>	odoc = ox.Document
>	gcIPAddress = odoc.Body.InnerText
>
>	gcIPAddress = Substr(gcIPAddress,1,50)
>	lnStart = At( Left( Chrtran(gcIPAddress, Chrtran(gcIPAddress, "0123456789", ""), ""),1), gcIPAddress)
>	lnEnd = Rat( Right( Chrtran(gcIPAddress, Chrtran(gcIPAddress, "0123456789", ""), ""),1), gcIPAddress)
>	gcIPAddress = Substr(gcIPAddress,lnStart,(lnEnd-lnStart)+1)
>
>	? ":"+gcIPAddress+":"
>
>Endif
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform