Sample code for 30+ languages & platforms
PowerBuilder

Find My External Public IP Address

See more HTTP Examples

To find your external public IP address (not your LAN IP address, such as 192.168.1.* or 172.16.16.*, etc), your application would need to send a request to an HTTP server that can report back on the origin IP address. You can easily write a simple script on your own web server to do it, or you can use a service such as ipify.org.

This example shows how to send a request to the ipify.org endpoint to get your public IP address.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_Http
string ls_My_ip_address

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if
ls_My_ip_address = loo_Http.QuickGetStr("https://api.ipify.org")
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    return
end if

Write-Debug "My Public IP Address: " + ls_My_ip_address


destroy loo_Http