Autor Beitrag
chrisx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Sa 24.12.05 15:44 
Hallo, ich habe folgendes Tutorial nachgemacht mit delphi 6: www.swissdelphicente...showcode.php?id=1087

Wenn ich das Programm starte und eine Nachricht seden will, kommt der Fehler "No adress specified".
Wieso?

ps. ich habe das Tut. etwas verändert:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ScktComp;

type
  TForm1 = class(TForm)
    ClientSocket1: TClientSocket;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    Edit4: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure ClientSocketConnect(Sender: TObject;
      Socket: TCustomWinSocket);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  csend: string;
implementation

{$R *.dfm}


procedure TForm1.ClientSocketConnect(Sender: TObject;
  Socket: TCustomWinSocket);
begin
clientsocket1.Socket.SendText(csend);
  clientsocket1.Active := False;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
cSend := 'POST http://wwp.icq.com/scripts/WWPMsg.dll HTTP/2.0' + chr(13) + chr(10);
  cSend := cSend + 'Referer: http://wwp.mirabilis.com' + chr(13) + chr(10);
  cSend := cSend + 'User-Agent: Mozilla/4.06 (Win95; I)' + chr(13) + chr(10);
  cSend := cSend + 'Connection: Keep-Alive' + chr(13) + chr(10);
  cSend := cSend + 'Host: wwp.mirabilis.com:80' + chr(13) + chr(10);
  cSend := cSend + 'Content-type: application/x-www-form-urlencoded' + chr(13) + chr(10);
  cSend := cSend + 'Content-length:8000' + chr(13) + chr(10);
  cSend := cSend + 'Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*' +
    chr(13) + chr(10) + chr(13) + chr(10);
  cSend := cSend + 'from=' + Edit1.Text + ' &fromemail=' + Edit2.Text +
    ' &fromicq='+ Edit4.Text + ' &body=' + Memo1.Text + ' &to=' + Edit3.Text + '&Send=';
  clientsocket1.Active := True;
end;



end.


So sieht mein Programm aus:
user defined image
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 01.01.06 10:09 
Du hast ja nirgendwo angegeben "wohin" sich die Sockets connecten sollen
Du brauchst einen Port und einen Host ohne die beiden geht da nischt
Aber schau dir erstmal ein Sockets Tut an hier der
www.dsdt.info/tutorials/winsocket/
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 01.01.06 10:15 
LOL Hab mir grad mal das Nahricht an ICQ senden Code Teil von Suiss Delphi Center durchgelesen da steht doch groß und Fett "Set the TClientsocket's Port to 80 and the Host to wwp.mirabilis.com."
Also du schreibst bei Button1.Click ()...
einfach noch vor ClientSocket1.Active:=True;
ClientSocket1.Port:=80;
ClientSocket1.Host:='wwp.mirabilis.com';
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 01.01.06 11:40 
Alternativ würd ich dir die TICQClient-Komponente empfehlen.
Du findest sie auf Torry, wobei sie dort nicht mehr aktuell sind.
Ich such nochmal den Link für die aktuelleren raus.

Damit kannst du ganz einfach Nachrichten senden, empfangen, ...

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
LexXis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 170
Erhaltene Danke: 3



BeitragVerfasst: Mo 16.01.06 21:26 
Ich möchte an dieser Stelle nur ma kurz drauf hinweisen, dass ich das Tut auch ausprobiert hab und mir bei der gelegenheit durch nen _KLITZEKLEINEN_ anwenderfehler mein icq-account zerschossen hab ^^

Ich kann meinen Nick ändern wie ich will, ich bekomm aber permanent nur "t5y4e0" angezeigt und alle anderen Kontakte von mir sehen den Nick auch so!

Also entweder hab ich mich mal ganz ganz böse verklickt, oder aber der Code funktioniert nicht richtig.

So long..