Find my ip

Post Reply
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Find my ip

Post by Marco Turco »

Hi all,
anyone know how can I get my computer ip ?

Thanks
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
pablovidal
Posts: 398
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana
Contact:

Re: Find my ip

Post by pablovidal »

Public or Private
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Find my ip

Post by James Bott »

Code: Select all

/* Purpose: Find Internet IP address
Note: Must also link xHarbour\source\tip\url.prg
                                   xHarbour\source\tip\client.prg
I have not tested this - J Bott
*/



#include "fivewin.ch"
#include "tip.ch"


function main()
   msgInfo( getMyIP() )
return nil

function GetMyIP( cURL )
   local cMyIP := ""
   local oUrl, oClient
   cURL := if( empty(cURL), "http://www.whatismyip.org/", cURL )
   oUrl := tURL():New( cURL )
   if !empty( oUrl )
      oClient := tIPclient():new( oUrl )
      if !empty( oClient )
         oClient:nConnTimeOut := 20000
         if oClient:Open( oUrl )
            cMyIP := oClient:Read(80)
            oClient:Close()
         endif
      endif
   endif
return cMyIP
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Find my ip

Post by anserkk »

Hi,

To get the LAN/Internal IP

Code: Select all

#include "FiveWin.Ch"
//---------------------------//
Function Main()

   Local cMyLAN_IP

   WsaStartUp()
   cMyLAN_IP := GetHostByName( GetHostName() )
   WsaCleanUp()

   MsgInfo("Your current LAN IP-address is : " + cMyLAN_IP )

Return
Regards
Anser
User avatar
Willi Quintana
Posts: 859
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú
Contact:

Re: Find my ip

Post by Willi Quintana »

HI, see this code,,,,

Code: Select all

//--------------------------------------------------------------------------------------
Function GetIp(oWnd)
local nIp,oSocket,cIp, nLen

oSocket := TSocket():New( 2000 )  
cIp := oSocket:cIPAddr
oSocket:End()
cIp := If(Empty(cIp),"127.0.0.1",cIp)
Return(cIp)
 
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Re: Find my ip

Post by Marco Turco »

I was looking for the internal ip.
Thank to all for the support.
Best Regards,

Marco Turco
SOFTWARE XP LLP
anbinal
Posts: 3
Joined: Mon Sep 03, 2012 6:55 am

Re: Find my ip

Post by anbinal »

Marco Turco wrote:Hi all,
anyone know how can I get my computer ip ?

Thanks

What ip address do you need?
If you need your computer ip do the following instructions
For Windows xp
1.start->Run
2.cmd
3.Type ipconfig
4.press enter
If you need your internet ip address visit ip-details.com .Here you can get location of your ip, longitude.latitude also
Post Reply