get your external IP

get your external IP

Postby Jimmy » Sun May 05, 2024 4:24 pm

hi,

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

or try
https://ifconfig.co/
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: get your external IP

Postby nageswaragunupudi » Mon May 06, 2024 1:30 am

Nice, thanks.

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10290
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: get your external IP

Postby Enrrique Vertiz » Mon May 06, 2024 3:11 am

Greetings, question and how will the IPV4 be obtained?
Thank you
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 24.02, MySQL 8.0.X, SQLLIB 1.9m
Enrrique Vertiz
 
Posts: 519
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru

Re: get your external IP

Postby Antonio Linares » Mon May 06, 2024 3:22 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41356
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: get your external IP

Postby Enrrique Vertiz » Mon May 06, 2024 3:34 am

Gracias !!!
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 24.02, MySQL 8.0.X, SQLLIB 1.9m
Enrrique Vertiz
 
Posts: 519
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru

Re: get your external IP

Postby Enrrique Vertiz » Mon May 06, 2024 3:51 am

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
Enrrique Vertiz Pitta
Lima-Peru
xHb 1.23.1026X, Fwh 24.02, MySQL 8.0.X, SQLLIB 1.9m
Enrrique Vertiz
 
Posts: 519
Joined: Fri Oct 07, 2005 2:17 pm
Location: Lima - Peru

Re: get your external IP

Postby anserkk » Mon May 06, 2024 4:43 am

I am using Windows 11 Pro, Version 23H2

I am getting the local IP via GetHostByName( GetHostName() )
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: get your external IP

Postby nageswaragunupudi » Mon May 06, 2024 8:09 am

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10290
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: get your external IP

Postby Antonio Linares » Mon May 06, 2024 8:25 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41356
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: get your external IP

Postby nageswaragunupudi » Mon May 06, 2024 8:40 am



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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10290
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests