Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros temas > Trucos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Los mejores trucos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 21-09-2006
Avatar de vtdeleon
vtdeleon vtdeleon is offline
Miembro
 
Registrado: abr 2004
Ubicación: RD & USA
Posts: 3.236
Poder: 23
vtdeleon Va por buen camino
Saber Ip Pública

Funcion para saber la ip pública. Necesita las unidades IdHTTP y WinInet.

Codigo recogido en el Foro.
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;
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:55:40.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi