Page 1 of 1

Find my ip

Posted: Sun Aug 15, 2010 12:19 pm
by Marco Turco
Hi all,
anyone know how can I get my computer ip ?

Thanks

Re: Find my ip

Posted: Sun Aug 15, 2010 2:28 pm
by pablovidal
Public or Private

Re: Find my ip

Posted: Sun Aug 15, 2010 2:51 pm
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

Re: Find my ip

Posted: Mon Aug 16, 2010 5:19 am
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

Re: Find my ip

Posted: Mon Aug 16, 2010 3:02 pm
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)
 

Re: Find my ip

Posted: Tue Aug 17, 2010 6:04 pm
by Marco Turco
I was looking for the internal ip.
Thank to all for the support.

Re: Find my ip

Posted: Mon Sep 03, 2012 7:15 am
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