Autor Beitrag
CABALxx
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 174


D7 Ent
BeitragVerfasst: Di 10.02.04 18:18 
Alsoooo ich bins mal wieder
der neuling der keine ahung hat :lol:

folgendes

ich hab den folgenden code mal an anderer stelle bekommen als ich sagte ich wolle eine art "quizbot" schreiben der sich in den kleinen privat chat von mir und nem kumpel einloggt und dort fragen stellt

aber um was es da eigentlich ging war....... das er den chat nach antworten durchsuchen sollte.....

nun habe ich den code hier bekommen..

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.Button2Click(Sender: TObject); 
var 
 MyDocument: IHTMLDocument3; 
 Quiz: IHTMLInputElement; 
begin 
 MyDocument := webbrowser1.Document as IHTMLDocument3; 
 if Assigned(Mydocument) then 
 begin 
  Quiz := 
   (MyDocument.getElementsByName('Dein_Formularobjekt').item(0, '') as IHTMLInputElement); 
  Quiz.value := '700.00'; // Or what ever value you want... 
   Quiz.form.submit; 
 end; 
end;


nur ich verstehe nicht ganz was der macht :?:
Füllt der nur was aus ? liest der nur was aus ? sucht der ? und wofür steht sowas wie
ausblenden Delphi-Quelltext
1:
 (MyDocument.getElementsByName('Dein_Formularobjekt').item(0, '') as IHTMLInputElement);					

oder diese zahl da
ausblenden Delphi-Quelltext
1:
Quiz.value := '700.00';					


also ich versteh den code nicht vielleicht kann mir ja einer erklären
würd mich freuen :D


Zuletzt bearbeitet von CABALxx am Di 02.03.04 20:00, insgesamt 1-mal bearbeitet
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 10.02.04 18:30 
ich versuchs mal:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Button2Click(Sender: TObject);  
var  
 MyDocument: IHTMLDocument3; // DHTML Element, Webbrowser see DHTMLEDIT bzw. TriEdit 
 Quiz: IHTMLInputElement; // DOM Element  
begin  
 MyDocument := webbrowser1.Document as IHTMLDocument3;  
  // Wrapper, WebBrowser wird als DOM gemappt
 if Assigned(Mydocument) then  
 begin  
  // auf der Page die der Browser anzeigt gibts ein (HTML) Element
  // mit dem Namen 'Dein...' ist eine simple Eingabezeile
  // jetzt wird das Eingabeelement gemappt
  Quiz :=  
   (MyDocument.getElementsByName('Dein_Formularobjekt').item(0, '') as IHTMLInputElement);  
  // in der Eingabezeile soll jetzt der Text(700.00) stehen
  Quiz.value := '700.00'; // Or what ever value you want... 
  // das ganze der Form soll submited werden
   Quiz.form.submit;  
 end;  
end;


fertig
grez
msch

Schau dir das SDK zu DHMTL an, steht alles drinne.

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
CABALxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 174


D7 Ent
BeitragVerfasst: Di 10.02.04 19:14 
das heisst
also
dieses ding schreibt nur irgend nen text in irgendein formular einer seite die im TWebBrowser angezeigt wird ?
na toll das genau sowas was ich nich brauche..........

big thx
ich hoff ich habs richtig verstanden...
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 10.02.04 19:20 
yeap, korrekt.
grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
CABALxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 174


D7 Ent
BeitragVerfasst: Di 10.02.04 19:26 
thx für die schnelle hilfe
:lol:
den code kannsch dann vergessen

thx :) :) :)