Hello Comunity.
For anyone who has experience with work on the net, could give a hint on the best way to get the Public IP in an application xBase..
Thanks in advance.
Pedro
Get Public IP
Re: Get Public IP
Hi,
Something as:
cResult := loadfromurl("http://checkip.dyndns.org/")
cResult will contain the following: Current IP Address: 194.78.56.73
Then you can get the IP:
cMyIp := substr( cResult , at(":",cResult)+2)
or
cMyIp := dc_tokenarray(cResult,":")[2]
Something as:
cResult := loadfromurl("http://checkip.dyndns.org/")
cResult will contain the following: Current IP Address: 194.78.56.73
Then you can get the IP:
cMyIp := substr( cResult , at(":",cResult)+2)
or
cMyIp := dc_tokenarray(cResult,":")[2]
Re: Get Public IP
Hi Cris.
many thanks for feed Back.
LoadFromUrl() works well for me and even better with this link :
Function GetPublicIPAddress()
LOCAL cIP := LoadFromURL('http://ipecho.net/plain')
return cIP
Sounds like a good solution and does not need external Libs
However someone knows a more recent technique?
Thanks..
Pedro
many thanks for feed Back.
LoadFromUrl() works well for me and even better with this link :
Function GetPublicIPAddress()
LOCAL cIP := LoadFromURL('http://ipecho.net/plain')
return cIP
Sounds like a good solution and does not need external Libs
However someone knows a more recent technique?
Thanks..
Pedro
Pedro Alexandre