Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Trucos (https://www.clubdelphi.com/foros/forumdisplay.php?f=52)
-   -   Enviar un IcqPage con el TclientSocket (https://www.clubdelphi.com/foros/showthread.php?t=80656)

dec 01-07-2006 00:07:01

Enviar un IcqPage con el TclientSocket
 
Para hacer este truco debes colocar:

Dos Tedit, un memo, un boton y el TclientSocket que para simplificar las cosas le pondremos el nombre "Icq".

El Edit1 usaremos para colocar el numero Icq del Destinatario

El Edit2 para el Subject

El memo para escribir el mensaje. (el destinatorio solo recibira los primeros 450 carateres)

Al TclientSocket le pondremos los siguientes valores en las propiedades.

Código:

Port-->80
Host-->http://wwp.icq.com
Name-->Icq (para no usar nombres largos)

En el evento "OnConnect" pondremos:

Código Delphi [-]
procedure TForm1.IcqConnect(Sender: TObject; Socket: TCustomWinSocket);
var
 Pag:String;
Begin
  Pag := 'POST /scripts/WWPMsg.dll HTTP/1.0' + chr(13) + chr(10);
  Pag := Pag + 'Referer: http://www.clubdelphi.com' + chr(13) + chr(10);
  Pag := Pag + 'User-Agent: PeterSoft (WinMe; I)' + chr(13) + chr(10);
  Pag := Pag + 'Connection: Keep-Alive' + chr(13) + chr(10);
  Pag := Pag + 'Host: "http://wwp.icq.com":80' + chr(13) + chr(10);
  Pag := Pag + 'Content-type: application/x-www-form-urlencoded' + chr(13) + chr(10);
  Pag := Pag+ 'Content-length: 80' + chr(13) + chr(10);
  Pag := Pag + 'Accept:Text/html' + chr(13) + chr(10) + chr(13) + chr(10);
  Pag := Pag + 'from=Pedro Luque &fromemail=pedro@luque.net.ar &subject='
          + edit2.Text + ' &body=' + memo1.text + ' &to=' + edit1.text + '&Send=';
  Icq.Socket.SendText(PAg);
  Icq.Active := false
end;

Y en el Click del boton:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin
  Icq.Active:=True;
end;

Y a mandar IcqPager a lo loco :)


La franja horaria es GMT +2. Ahora son las 12:08:41.

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