Autor Beitrag
Juliman
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Do 06.01.05 17:12 
Hallo Leute!

Ich würde gern ein prog schreiben, mit dem ich mich selbst einloggen kann. z.B. auf web.de dafür müsste ich also in ein inputfeld etwas eintragen. Das ganze zweimal. Und dann "auf den Button drücken". Wie kann ich das mit delphi machen??

danke,
Julian
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Do 06.01.05 17:20 
Juliman hat folgendes geschrieben:
Wie kann ich das mit delphi machen??

Mit der TWebBrowser Komponente.

_________________
Ciao, Sprint.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 06.01.05 17:32 
Hi!!

Wie soll man das denn genau dann machen mit TWebbrowser???

Am besten Code-Beispiel... :wink: :lol:

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Do 06.01.05 17:43 
WeBsPaCe hat folgendes geschrieben:
Wie soll man das denn genau dann machen mit TWebbrowser?


ausblenden Delphi-Quelltext
1:
  WebBrowser1.Navigate('http://www.web.de');					

ausblenden Delphi-Quelltext
1:
2:
3:
  WebBrowser1.OleObject.document.forms.item('fm').item('username').value := 'MyUsername';
  WebBrowser1.OleObject.document.forms.item('fm').item('password').value := 'MyPassword';
  WebBrowser1.OleObject.document.forms.item('fm').item('rv_dologon').click;

_________________
Ciao, Sprint.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 06.01.05 18:17 
SUPER!!! Danke... Das probier ich gleich mal aus... :D

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Fr 07.01.05 15:31 
Okay, cool! Danke!

Aber wie kann ich das jetzt machen, dass er den Benutzernamen aus einer Datei liest??
Und wie kann ich das machen, dass er auf der Seite nach einem Wort sucht, und wenn das gefunden wurde, dann es nochmal probiert??
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 07.01.05 15:55 
Aus welcher datei willstu das denn rauslesen?? Aus ner INI, dann isses einfach...

Die andere Frage, raff' ich net!!

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Fr 07.01.05 16:03 
am besten wäre eine *.TXT Datei! Aber wie geht das da mit??
und wenn das keiner weiß, dann: Wie geht das mit ner *.INI Datei??

Die 2. Frage:

Wenn jetzt z.B. ich mich bei web.de das letzte mal nicht ausgeloggt habe, dann steht das vorher nocheinmal auf einer anderen seit. um das zu verhindern, das ich dann mit dieser falschen Seite weiterarbeite, will ich, dass man z.B. auf der geladenen Seite nach z.B. dem Wort 'Logout' sucht. und wenn er das findet, dann soll er nocheinmal zurück gehen und sich noch einmal einloggen. Wenn er dies aber nicht findet soll er dann z.B. eine message mit login-Vorgang erfolgreich oder so!

Danke!
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 07.01.05 16:07 
Zitat:
Die 2. Frage:

Wenn jetzt z.B. ich mich bei web.de das letzte mal nicht ausgeloggt habe, dann steht das vorher nocheinmal auf einer anderen seit. um das zu verhindern, das ich dann mit dieser falschen Seite weiterarbeite, will ich, dass man z.B. auf der geladenen Seite nach z.B. dem Wort 'Logout' sucht. und wenn er das findet, dann soll er nocheinmal zurück gehen und sich noch einmal einloggen. Wenn er dies aber nicht findet soll er dann z.B. eine message mit login-Vorgang erfolgreich oder so!

Ich kenn web.de auch!! :wink: Da würd ich einfach da unten den Haken rausmachen, dann kommt diese Meldung nimmer.

Und das mit der .ini müsste auch mit ner .txt gehn.
Ich nehm an, du willst da drinne Username und PWD speichern??

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 07.01.05 16:21 
Ich nehm das einfach mal an... :wink:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
ConfigFile: TIniFile;
begin
ConfigFile := TIniFile.Create(ExtractFileDir(ParamStr(0))+'\config.txt');
ConfigFile.WriteString(InputBox('config.txt', 'Section?', 'nop'), InputBox('config.txt', 'Ident?', 'nop'), InputBox('config.txt', 'Value?', 'nop'));
ConfigFile.Free;
end;


Und oben bei uses noch die Unit IniFiles eintragen!!!

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Fr 07.01.05 16:39 
danke!
Aber ich will ja net die usernames in eine TXT datei schreiben, sondern aus einer datei herauslesen... wie mahce ich das denn??
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Fr 07.01.05 16:44 
Das mit dem "Logout vergessen" war nur ein Bsp. Wie kann ich das denn machen mit dem suchen??
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Fr 07.01.05 17:03 
Hi
Mal ne andere Frage. Wenn ich nicht recht hab einfach ignorieren.
Mir sieht es ganz so aus als willst du ein Programm zum eMail abrufen schreiben. Das geht auch einfacher mit idPop3.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 07.01.05 17:53 
Zitat:
Aber ich will ja net die usernames in eine TXT datei schreiben, sondern aus einer datei herauslesen... wie mahce ich das denn??


Das geht so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var  
ConfigFile: TIniFile;  
begin  
ConfigFile := TIniFile.Create(ExtractFileDir(ParamStr(0))+'\config.txt');  
ConfigFile.ReadString(InputBox('config.txt', 'Section?', 'nop'), InputBox('config.txt', 'Ident?', 'nop'), 'nop');  
ConfigFile.Free;  
end;

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Fr 07.01.05 21:16 
So soll die *.TXT Datei aussehen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
[usernames]
user1
user2
...

[passwoerter]
passwort1
passwort2
...


Und dann sol das Prog diese Werte nacheinander laden und ausprobieren, wenn eine erfolgreiche anmeldung geschehen ist, dann soll er stoppen und den benutzernamen + passwd anzeigen.

Hoffe mir kann jemand helfen!

Danke

MfG Julian
Spieler1
ontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 469


D6 Pers
BeitragVerfasst: Fr 07.01.05 21:58 
Juliman hat folgendes geschrieben:
So soll die *.TXT Datei aussehen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
[usernames]
user1
user2
...

[passwoerter]
passwort1
passwort2
...


Und dann sol das Prog diese Werte nacheinander laden und ausprobieren, wenn eine erfolgreiche anmeldung geschehen ist, dann soll er stoppen und den benutzernamen + passwd anzeigen.

Hoffe mir kann jemand helfen!

Danke

MfG Julian
Verwende doch gleich eine INI Datei. Dafür gibt es dann auch gleich Klassen von Delphi. ;)
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Sa 08.01.05 17:16 
Ja meinend wegen auch das! Aber wie??

Hoffe ihr könnt mir helfen!
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 08.01.05 17:31 
Zufällig beschäftige ich mich auch gerade mit ini
www.dsdt.info/tutorials/ini/?page=1
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 08.01.05 17:32 
Es geht doch auch mit 'ner TXT:
Die TXT hat zwei Zeilen und sieht folgendermaßen aus:
ausblenden Quelltext
1:
2:
MeinBenutzername
Meinpasswort

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
var 
  Liste: TStringList;
  Password, Username: String;

procedure TForm1.FormCreate(...);
begin
  try
    Liste := TStrigList.Create;
    Liste.LoadFromFile('C:\Liste.txt');
    Username := Liste.Strings[0]; 
    Password := Liste.Strings[1];
  finally
    Liste.Free;
  end;
  //...
end;


Zuletzt bearbeitet von Radioactive am So 09.01.05 17:35, insgesamt 1-mal bearbeitet
Juliman Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 81



BeitragVerfasst: Sa 08.01.05 17:55 
Jo!° Danke! Das hilft mir schon weiter. Aber wie kann ich das jetzt machen, dass das Prog prüft, ob es erfolgreich war oder nicht??

Und wie kann ich das machen, das er das solange mit verschiedenen Benutzernamen und Passwörtern macht?

Hoffe iht könnt helfen!

Dankeschön, euer Julian