Autor Beitrag
HellAngel28
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Di 15.07.03 20:29 
ich will über mein programm ICQ msgs verschicken können, wie geht das?
thx :)

(ich hab das gefühl es geht ziemlich einfach.. aber ich komm net drauf)

Moderiert von user profile iconTino: Titel geändert.
Ak-Alex
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 16.07.03 08:58 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.Button1Click(Sender: TObject); 
var 
  i: Integer; 
  EncodedStr: string; 
  Header: OleVariant; 
  Post: OleVariant; 
begin 
    EncodedStr := 'from=Name&fromemail=email&body=text'; 

 
  Post := VarArrayCreate([0, Length(EncodedStr) - 1], varByte); 


  for I := 1 to Length(EncodedStr) do 
    Post[I - 1] := Ord(EncodedStr[I]); 

  Header := 'Content-Type: application/x-www-form-urlencoded' + #10#13; 

  WebBrowser1.Navigate('http://wwp.icq.com/123456789', EmptyParam, 
    EmptyParam, Post, Header); {123456789 steht für die uin}
end;



habs nur noch nicht testen können....

Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt
Ak-Alex
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 16.07.03 09:06 
musst dann nur noch den senden button im formular drücken wenns geklappt hat per webbrowser1.oleobject...

ungefähr so:

mshtml bitte in uses einbinden

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:
var 
  iDoc: IHtmlDocument2; 
  i: integer; 
  ov: OleVariant; 
  iDisp: IDispatch; 
  iColl: IHTMLElementCollection; 
  InputImage: HTMLInputImage; 
begin 
  WebBrowser1.ControlInterface.Document.QueryInterface(IHtmlDocument2, iDoc); 
  if not Assigned(iDoc) then 
  begin 
    Exit; 
  end; 
  ov := 'INPUT'; 
  iDisp := iDoc.all.tags(ov); 
  if Assigned(IDisp) then 
  begin 
    IDisp.QueryInterface(IHTMLElementCollection, iColl); 
    if Assigned(iColl) then 
    begin 
      for i := 1 to iColl.Get_length do 
      begin 
        iDisp := iColl.item(pred(i), 0); 
        iDisp.QueryInterface(HTMLInputImage, InputImage); 
        if Assigned(InputImage) then 
        begin 
          if InputImage.Name = 'submit' then 
          
          begin 
            InputImage.Click;  
          end; 
        end; 
      end; 
    end; 
  end; 
end;


Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt
Ak-Alex
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 16.07.03 09:48 
Und ich habs so realisiert....

vielleicht hilft dir der code....der funktioniert 100%ig!

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:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, SHDocVw, mshtml, ComCtrls;

type
  TForm1 = class(TForm)
    WebBrowser1: TWebBrowser;
    Label1: TLabel;
    GroupBox1: TGroupBox;
    Button1: TButton;
    Edit1: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    Edit2: TEdit;
    Label4: TLabel;
    Edit3: TEdit;
    Memo1: TMemo;
    ProgressBar1: TProgressBar;
    procedure WebBrowser1DocumentComplete(Sender: TObject;
      const pDisp: IDispatch; var URL: OleVariant);
    procedure WebBrowser1ProgressChange(Sender: TObject; Progress,
      ProgressMax: Integer);
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  k : integer;

implementation

{$R *.dfm}
function FillForm(WebBrowser: TWebBrowser; FieldName: string; Value: string): Boolean;  
var
  i, j: Integer;
  FormItem: Variant;  
begin  
  Result := False;  

  if WebBrowser.OleObject.Document.all.tags('FORM').Length = 0 then  
  begin  
    Exit;  
  end;  

  for I := 0 to WebBrowser.OleObject.Document.forms.Length - 1 do
  begin  
    FormItem := WebBrowser.OleObject.Document.forms.Item(I);  
    for j := 0 to FormItem.Length - 1 do  
    begin  
      try  

        if FormItem.Item(j).Name = FieldName then
        begin  
          FormItem.Item(j).Value := Value;  
          Result := True;  
        end;  
      except  
        Exit;  
      end;  
    end;  
  end;
end;

procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);
  var
   iDoc: IHtmlDocument2; 
  i: integer; 
  ov: OleVariant; 
  iDisp: IDispatch; 
  iColl: IHTMLElementCollection; 
  InputImage: HTMLInputImage;
begin
if k < 1 then
begin
   if FillForm(WebBrowser1, 'from', Edit2.Text) = False then
    ShowMessage('Error. Field not available or no Form found.');
     if FillForm(WebBrowser1, 'fromemail', Edit3.Text) = False then
    ShowMessage('Error. Field not available or no Form found.');
     if FillForm(WebBrowser1, 'body', Memo1.Text) = False then
    ShowMessage('Error. Field not available or no Form found.');
  WebBrowser1.ControlInterface.Document.QueryInterface(IHtmlDocument2, iDoc); 
  if not Assigned(iDoc) then 
  begin
    Exit; 
  end; 
  ov := 'INPUT'; 
  iDisp := iDoc.all.tags(ov); 
  if Assigned(IDisp) then
  begin 
    IDisp.QueryInterface(IHTMLElementCollection, iColl); 
    if Assigned(iColl) then 
    begin 
      for i := 1 to iColl.Get_length do 
      begin 
        iDisp := iColl.item(pred(i), 0); 
        iDisp.QueryInterface(HTMLInputImage, InputImage); 
        if Assigned(InputImage) then 
        begin
          if InputImage.alt = 'Send' then

          begin
            InputImage.Click;
              k := k + 1;
          end; 
        end; 
      end; 
    end; 
  end;
  end;
end;


procedure TForm1.WebBrowser1ProgressChange(Sender: TObject; Progress,
  ProgressMax: Integer);
begin
   if ProgressMax = 0 then  
  begin
    Progressbar1.Position := 0;
    Exit;  
  end;
  try  
    if (Progress <> -1) and (Progress <= ProgressMax) then
    begin
      Progressbar1.Position := (Progress * 100) div ProgressMax;

      end
    else

      Progressbar1.Position := 0;
  except  
    on EDivByZero do Exit;  
  end;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
k := 0;
  Webbrowser1.Navigate('wwp.icq.com/' + Edit1.Text);


end;



procedure TForm1.FormShow(Sender: TObject);
begin
k := 0;
end;

end.


Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt (verwendet sie doch jetzt mal selbst *seufz*)
HellAngel28 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Do 17.07.03 17:36 
Titel: dank dir
danke für die hilfe :)
ich werds dann morgen gleich testen...:)
olliistmeinname
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59



BeitragVerfasst: Do 17.07.03 20:10 
Bei mir geht das Beispiel oben leider nicht *heul*
Ich komm auf die Seite , wo die User - Infos stehen , wenn ich in edit1 ne ICQ Nummer eingebe. Mehr passiert aber nicht.

_________________
Olliistmeinname und bin da für jede Dame
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Fr 18.07.03 20:38 
ähhm hier ist öfters die rede von einem Webbrowser1
ausblenden Quelltext
1:
  WebBrowser1.Navigate('http://wwp.icq.com/123456789', EmptyParam,					

welche Kompo ist dass denn ganau, dei finde ich nicht in meinem D6 :cry:

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
HellAngel28 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Fr 18.07.03 23:50 
TWebBrowser, ist standartmäßig bei D6 enterprise (unter Internet, ganz rechts :))
Ak-Alex
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mo 21.07.03 13:23 
müsste aber funktionieren, habs getestet.....
HellAngel28 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Mo 21.07.03 13:46 
Titel: komsich
hmm ich habs probiert.. hat aber nicht wirklich funktioniert..
er hat keine fehler meldungen gebracht oder so.. hat aber auch keine ICQ msg geschickt..
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mo 21.07.03 14:05 
@ HellAngel28:
hmm, ich habe leider D6 Personal und unter Internet habe ich nur den Client bzw. Server socket.
Also wo bekomme ich diese Kompo her?

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
Jakyll
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Mo 28.07.03 22:47 
@ hibbert:
Kannste auch mit ClientSocket realisieren!
ausblenden 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:
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:111111111' + ' &body=' + memo1.Text + ' &to=' + edit3.Text + '&Send=';
  clientsocket1.Active := True; 

end;

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

end;

Ich denke der Code erklärt sich von selbst....

Gruß Jakyll
Cyrus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Di 29.07.03 09:54 
Das ist meine Lösung:

ausblenden volle Höhe 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:
private
    cs:TClientSocket;
    cSend:string;
    Procedure CSonConnect(Sender: TObject;
    Socket: TCustomWinSocket);
...
....

procedure SendICQ(FromIcqNr:string; ToIcqNr:string; FromMail:string; Mtext:string); //ueses Winsock
begin
  cs:=TClientSocket.Create(nil);
  cs.OnConnect:= CSonConnect;
  cs.Host:='wwp.mirabilis.com';
  cs.port:=80;
  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=' + FromIcqNr + ' &fromemail=' + FromMail +
    ' &fromicq:'+FromIcqNr + ' &body=' + Mtext + ' &to=' + ToIcqNr + '&Send=';
  cs.Active:=true;
end;

Procedure CSonConnect(Sender: TObject;
  Socket: TCustomWinSocket );
begin
  cs.Socket.SendText(csend);
  cs.Active:=false;
  cs.Free;
end;

Greetz Cyrus

_________________
Wer glaub er ist, hört auf zu werden!
Delphi Rulez!!!
Think
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Di 02.12.03 09:04 
Hallo, habe noch Delphi5 Personal Edition und habe es so probiert, es wird auch was gesendet aber der ICQ Empfänger bekommt keine Nachricht.
Hatt sich vieleicht bei ICQ was geändert das es so nicht mehr geht? :?:
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 02.12.03 14:31 
also von der website aus, wie es hier manche versionen beschrieben haben geht es nur noch mit einem schlüsselwort...das dürfte aber mit delphi schwer rauszufinden sein...


alle post möglichkeiten sind damit ausgeschöpft...icq liefert aber ne dll, mit der das senden möglich ist. schau doch dazu auch mal bei torry.net vorbei!

gruß

ixtreme.de