Hi,!
I want get IP Address on Clien of LAN, but I don't know what to use for get it. I need your help, please. Thanks all...!
Hi,!
I want get IP Address on Clien of LAN, but I don't know what to use for get it. I need your help, please. Thanks all...!
How to get IP Address on Clien of LAN....? Help me!!!!!!
Mohit17
Jason.J
If you need to get IP address of any client i LAN, you can use something like this :
DECLARE INTEGER
WSACleanup IN ws2_32DECLARE STRING inet_ntoa IN ws2_32 INTEGER in_addr
DECLARE INTEGER
gethostbyname IN ws2_32 STRING hostDECLARE INTEGER
WSAStartup IN ws2_32 INTEGER wVerRq, STRING lpWSADataDECLARE
RtlMoveMemory IN kernel32 As CopyMemory; STRING @Dest, INTEGER Src, INTEGER nLengthIF
WSAStartup(0x202, Repli(Chr(0),512)) = 0 && computer name = WSACleanup()ENDIF
FUNCTION
GetIP(cServer) DEFINE HOSTENT_SIZE 16 LOCAL nStruct, nSize, cBuffer, nAddr, cIPnStruct = gethostbyname(cServer)
IF nStruct = 0 RETURN '0.0.0.0' ENDIF cBuffer = Repli(Chr(0), HOSTENT_SIZE)cIP =
Repli(Chr(0), 4)= CopyMemory(@cBuffer, nStruct, HOSTENT_SIZE)
= CopyMemory(@cIP, buf2dword(
SUBS(cBuffer,13,4)),4)= CopyMemory(@cIP, buf2dword(cIP),4)
RETURN
inet_ntoa(buf2dword(cIP))FUNCTION
buf2dword(lcBuffer) (SUBSTR(lcBuffer, 1,1)) + ; Bitlshift(Asc(SUBS(lcBuffer, 2,1)),8) +; Bitlshift(Asc(SUBS(lcBuffer, 3,1)),16) +; Bitlshift(Asc(SUBS(lcBuffer, 4,1)),24)Biodigit
How about :-
o = CREATEOBJECT("MSWinsock.Winsock")
o.LocalIP
HTH,
Robbo.