Hi all,
anyone know how can I get my computer ip ?
Thanks
/* 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
#include "FiveWin.Ch"
//---------------------------//
Function Main()
Local cMyLAN_IP
WsaStartUp()
cMyLAN_IP := GetHostByName( GetHostName() )
WsaCleanUp()
MsgInfo("Your current LAN IP-address is : " + cMyLAN_IP )
Return
//--------------------------------------------------------------------------------------
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)
Marco Turco wrote:Hi all,
anyone know how can I get my computer ip ?
Thanks
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 52 guests