Free for PREMIUM members
[Webinar] Streamline your web hosting managementRegister Today
function LocalIp: string;
var IPW: TIdIPWatch;
Result := '127.0.0.1';
IpW := TIdIPWatch.Create(nil);
if IpW.LocalIP <> '' then
Result := IpW.LocalIP;
Open in new window
function LocalIP: string;
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
Buffer: array [0..63] of Ansichar;
Result := '';
phe := GetHostByName(Buffer);
if phe = nil then
pptr := PaPInAddr(phe^.h_addr_list);
i := 0;
while pptr^[i] <> nil do
Result := StrPas(inet_ntoa(pptr^[i]^));
procedure TForm1.Button1Click(Sender: TObject);
Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $349.00.
Premium members get this course for $37.50.
Premium members get this course for $95.20.
Premium members get this course for $259.00.
Premium members get this course for $159.20.
Premium members get this course for $174.99.
Premium members get this course for $151.20.