Ver Mensaje Individual
  #2  
Antiguo 21-09-2006
cecam cecam is offline
Miembro
 
Registrado: may 2006
Ubicación: Girona
Posts: 47
Reputación: 0
cecam Va por buen camino
A ver si te sirve esto . . .

Código Delphi [-]
function IP_Publica:string;
  function IsNumeric( T:string ):boolean;
  begin
    Result:=false;
    if (length(T)>0) then
      case T[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   IsNumeric(HTMLBody[i])
             or  (HTMLBody[i]='.')
             then Result:=Result+HTMLBody[i];
         end;
       finally
         IdHTTP.Free;
       end;
  end;
end;

Saludos!
Responder Con Cita