Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Commands for IP addresses
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01621482
Message ID:
01621520
Views:
59
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform