function LocalIP : string;<br>type<br>TaPInAddr = array [0..10] of PInAddr;<br>PaPInAddr = ^TaPInAddr;<br>var<br>phe : PHostEnt;<br>pptr : PaPInAddr;<br>Buffer : array [0..63] of char;<br>I : Integer;<br>GInitData : TWSADATA;<br><br>begin<br>WSAStartup($101, GInitData);<br>Result := '';<br>GetHostName(Buffer, SizeOf(Buffer));<br>phe :=GetHostByName(buffer);<br>if phe = nil then Exit;<br>pptr := PaPInAddr(Phe^.h_addr_list);<br>I := 0;<br>while pptr^ < > nil do begin<br>result:=StrPas(inet_ntoa(pptr^^));<br>Inc(I);<br>end;<br>WSACleanup;<br>end;