Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Commands for IP addresses
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01621482
Message ID:
01621520
Vues:
58
>Thank you for the links Mike.
>
>I subscribed and checked them out.
>But they all provide the Local Machine's IP Address.
>
>Not sure if it is even possible to get the "Public IP Address" from inside the network?..
>Unless, it is Posted (via Google search of "My IP Address"), and then read back from the website and parsed...
>I thought maybe somebody has sample code.
>
>As always appreciate your help.
>
>Cy
>
>>>What are the best commands to use in order to get the
>>>
>>>- Public (router) IP Address?
>>>- Computer's IP Address within the Network (listed via ipconfig)?
>>>
>>>Also is there a command to get the Host's Name and Host's Location?
>>>(as some of the website are able to show).
>>>
>>>Thanks
>>
>>http://www.news2news.com/vfp/index.php?example=233
>>http://www.news2news.com/vfp/index.php?example=215
>>http://www.news2news.com/vfp/index.php?example=217
#define TIMEOUT 30  && timeout 30 secondes
 
o = createobject("internetexplorer.application")
 o.Navigate("http://www.atoutfox.org/ip.asp")
 v_t = SECONDS()
 DO WHILE o.ReadyState<>4 AND (seconds() -v_t) <= TIMEOUT
   DOEVENTS
 ENDDO
 IF o.ReadyState<>4
   v_ip = "0.0.0.0"
 else
   v_ip = o.document.nameprop()
 ENDIF
 RELEASE o
 
? "Your IP address is : ", v_ip
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform