Find my ip

Find my ip

Postby Marco Turco » Sun Aug 15, 2010 12:19 pm

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

Thanks
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Find my ip

Postby pablovidal » Sun Aug 15, 2010 2:28 pm

Public or Private
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana

Re: Find my ip

Postby James Bott » Sun Aug 15, 2010 2:51 pm

Code: Select all  Expand view
/* 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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Find my ip

Postby anserkk » Mon Aug 16, 2010 5:19 am

Hi,

To get the LAN/Internal IP

Code: Select all  Expand view
#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
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Find my ip

Postby Willi Quintana » Mon Aug 16, 2010 3:02 pm

HI, see this code,,,,
Code: Select all  Expand view

//--------------------------------------------------------------------------------------
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
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Find my ip

Postby Marco Turco » Tue Aug 17, 2010 6:04 pm

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

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Find my ip

Postby anbinal » Mon Sep 03, 2012 7:15 am

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
anbinal
 
Posts: 3
Joined: Mon Sep 03, 2012 6:55 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests