Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 30-12-2004
Avatar de madman
madman madman is offline
Miembro
 
Registrado: may 2003
Ubicación: Nayarit, México
Posts: 242
Poder: 22
madman Va por buen camino
Saludos!
http://www.clubdelphi.com/foros/show...highlight=real
__________________
Guía de Estilo.
Responder Con Cita
  #2  
Antiguo 13-02-2005
garban garban is offline
Registrado
 
Registrado: jun 2004
Posts: 2
Poder: 0
garban Va por buen camino
Yo acabo de hacer un programa que se limita a averiguar la direccion IP publica leyendo una pagina web 'www.showmyip.com/es' que en el titulo te devuelve tu direccion ip publica y enviarla por correo a una direccion. solo tienes que poner un componente idsmtp y otro idmenssaje de la pestaña indy.
Si quieres puedes guardar esta direccion y comprobar cada 10 minutos si ha cambiado en cuyo caso mandas otro correo. A mi me funciona.

Juan

p.d. la funcion para leer un trozo de html no la he hecho yo, esta tal y como la encontre.



function LeerUnTrozoDeDocumentoHtmDesdeInternet( sUrl: string): string;
type
tbuffer = array[0..100] of char; // Aqui es donde puedes poner mas grande el buffer
pbuffer = ^TBuffer;
var
buffer : pbuffer;
a : cardinal;
ihConnect,
ihSession,
iDocument : HINTERNET;
begin
Result:='NadaDeNada'; // Observa que Length(Result)=10
ihConnect:=InternetOpen('dChat/2.0 (JulianWEB)', LOCAL_INTERNET_ACCESS, '', '', 0);
iDocument:=InternetOpenURL(ihConnect, pChar(sUrl), NIL, 1, INTERNET_FLAG_RELOAD or INTERNET_FLAG_DONT_CACHE or INTERNET_FLAG_RAW_DATA, 0);
if iDocument<>nil then try
New(buffer);
InternetReadFile(iDocument, Buffer, sizeof(TBuffer), a);
Result:=pchar(buffer);
finally
internetCloseHandle(iDocument);
Dispose(buffer);
InternetCloseHandle(ihConnect);
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
with mensaje do begin
Body.Clear;
Body.Add('Acaba de encender el ordenador');
Body.Add(copy(LeerUnTrozoDeDocumentoHtmDesdeInternet 'http://www.showmyip.com/es/'),59,15));
From.Text :='xxx@xxx.com';
Recipients.EMailAddresses := 'yyy@yyy.com';
Subject := 'Dirección IP xxx';
Priority := TidMessagePriority(mpHighest);
end;
with idSMTP1 do begin
AuthenticationType := atLogin;
Userid := 'xxx'; // Nombre del usuario
Password := 'xxx'; // la password
// Configuro el servidor SMTP.
Host := 'smtp.xxx.com';
Port := 25;
Connect;
Send(mensaje); // Envio el mensaje.
Disconnect;
end;
}
end;
Responder Con Cita
Respuesta



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 21:48:45.


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