Registriert seit: 12. Sep 2003
297 Beiträge
|
Re: Internet IP
2. Dez 2003, 19:47
Hallo,
in der Variablen pcIP steht dann die IP drinne ...
Delphi-Quellcode:
uses ... sysutils, WinSock, Windows ... ;
var wVersionRequested : Word;
var wsaData : TWSAData;
var Host : PHostEnt;
var caHostName : array[0..128] of char;
var pcIP : PChar;
begin
wVersionRequested := MAKEWORD(1, 1);
WSAStartup (wVersionRequested, wsaData);
GetHostName (@caHostName, 128);
Host := GetHostByName (@caHostName);
pcIP := iNet_ntoa(PInAddr(Host^.h_addr_list^)^);
|
|
Zitat
|