Page 1 of 1

get your external IP

PostPosted: Sun May 05, 2024 4:24 pm
by Jimmy
hi,

Code: Select all  Expand view
curl -4 ifconfig.co/json

or try
https://ifconfig.co/

Re: get your external IP

PostPosted: Mon May 06, 2024 1:30 am
by nageswaragunupudi
Nice, thanks.

Using this info
Code: Select all  Expand view
function PublicIP()
return BeforAtNum( "</span>", AfterAtNum( [-ip">], WebPageContents( "https://ifconfig.co/" ), 1 ), 1 )

Re: get your external IP

PostPosted: Mon May 06, 2024 3:11 am
by Enrrique Vertiz
Greetings, question and how will the IPV4 be obtained?
Thank you

Re: get your external IP

PostPosted: Mon May 06, 2024 3:22 am
by Antonio Linares

Re: get your external IP

PostPosted: Mon May 06, 2024 3:34 am
by Enrrique Vertiz
Gracias !!!

Re: get your external IP

PostPosted: Mon May 06, 2024 3:51 am
by Enrrique Vertiz
Saludos Antonio

Para obtener la direccion IP local utilizo: GetHostByName( GetHostName() ) y en Win10 funcion Ok, el resultado lo comprado con IpConfig y me da lo mismo.
Pero con Win11, me da un valor distinto al que me retorna IpConfig ... creo que algo ahi no esta Ok ...
Gracias

Re: get your external IP

PostPosted: Mon May 06, 2024 4:43 am
by anserkk
I am using Windows 11 Pro, Version 23H2

I am getting the local IP via GetHostByName( GetHostName() )

Re: get your external IP

PostPosted: Mon May 06, 2024 8:09 am
by nageswaragunupudi
Code: Select all  Expand view
GetHostByName( GetHostName() )

gives us the local IP of our PC in the Local Area Network.
Not the Public IP of our router

Re: get your external IP

PostPosted: Mon May 06, 2024 8:25 am
by Antonio Linares
Fixed for Windows 11. Solucionado:

Se incluye en el próximo build de FWH

Code: Select all  Expand view
function LocalIP()

   local cIP

   WSASTARTUP()
   cIP = GetHostByName( GetHostName() )
   WSACLEANUP()

return cIP

Re: get your external IP

PostPosted: Mon May 06, 2024 8:40 am
by nageswaragunupudi


Simple
Code: Select all  Expand view
function PublicIP()
return WebPageContents( "https://www.fivetechsoft.com/getip.php" )
 

Re: get your external IP

PostPosted: Mon Jun 03, 2024 6:07 am
by Antonio Linares

Re: get your external IP

PostPosted: Mon Jun 03, 2024 8:39 am
by Silvio.Falconi
I allready Used

Function GetIP()
Local cVar1
WsaStartUp()
cVar1 := GetHostByName( GetHostName() )
WsaCleanUp()
return cVar1