Esta función devuelve el dato que requieres:
Código Delphi
[-]
function IP_Publica: string;
function EsNumerico( S: string ): Boolean;
begin
Result := false;
if ( Length( S ) > 0 ) then
case S[1] of
'0'..'9': Result := True;
end;
end;
var
HTMLBody: string;
i: Integer;
IdHTTP: TIdHTTP;
begin
Result := '';
if WinInet.InternetGetConnectedState( nil, 0 ) then
begin
IdHTTP := TIdHTTP.Create( Application );
try
HTMLBody := IdHTTP.Get( 'http://checkip.dyndns.org/' );
for i := 0 to Length( HTMLBody ) - 1 do
begin
if EsNumerico( HTMLBody[i] ) or ( HTMLBody[i] = '.' ) then
Result := Result + HTMLBody[i];
end;
finally
IdHTTP.Free;
end;
end;
end;
Hay otras formas de obtenerla pero son mas complejas, para algo rápido esta funciona (hasta que dyndns cancele el servicio jejeje).