Autor Beitrag
stigge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Di 24.07.07 15:24 
Hallo,

ich versuche ein Programm zu schreiben, das sich auch anmelden können muss.
Ich habe jetzt folgenden Code:
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:
25:
procedure TForm1.Button1Click(Sender: TObject);
var slEintrag: tstringlist;
ausgabe: string;
begin
try
  slEintrag := TStringList.Create;
  with
  slEintrag do
  begin
    Values['username'] := '***';
    Values['password'] := '***';
    Values['ssl'] := 'on'//mit off gehts auch nicht...
  end;
  try
    ausgabe := IdHTTP1.Post('http://mydrive.ch/de/files.php',slEintrag);
  except
  begin
  showmessage('Es kann keine Verbindung zum Server aufgebaut werden');
  exit;
  end;
 finally
 slEintrag.Free;
 end;
 showmessage(ausgabe);
end;

Der Username und das Passwort stimmen auf jeden Fall, aber funktionieren tuts trotzdem nicht.
Ich bekomme immer einen Fehler "HTTP/1.1 302 Found".

Weiß jemand warum???
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Di 24.07.07 15:27 
302? ist das nicht, dass du das Redirect nicht eigeschaltet hast. Also: Weiterleitung aktivieren.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Di 24.07.07 15:34 
user profile iconRegan hat folgendes geschrieben:
302? ist das nicht, dass du das Redirect nicht eigeschaltet hast. Also: Weiterleitung aktivieren.

Hab ich jetzt gemacht, aber jetzt ist die Fehlermeldung: "IOHandler value is not valid".
Weiß heißt das jetzt wieder? :gruebel:
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Di 24.07.07 15:42 
Neue Frage neues Thread.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Di 24.07.07 15:45 
user profile iconRegan hat folgendes geschrieben:
Neue Frage neues Thread.

Eigentlich bezieht sich diese Nebenfrage auf die Hauptfrage aus dem ersten Post (Wieso geht der Code nicht) :wink:
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Di 24.07.07 15:58 
Dann würd ich mal chätzen du hast keinen IOHandler eingebaut.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Di 24.07.07 18:15 
user profile iconRegan hat folgendes geschrieben:
Dann würd ich mal chätzen du hast keinen IOHandler eingebaut.

Sagt mir ehrlichgesagt nicht sonderlich viel....Wie erstelle ich den einen IOHandler???
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Di 24.07.07 18:32 
Bei der idHTTP Komponente gibt es die Eigenschaft IOHandler. Dazu ziehst du einfach einen der vorhandenen (ich hab da keine Ahnung, aber es gibt z.b. "IdIOHandlerStream1") auf die Form und verlinkst den mit idHTTP.