Autor Beitrag
nilsener1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

Win 98, XP
D4 prof.
BeitragVerfasst: Di 23.11.04 13:45 
Hallo,

ich habe ein kleines FTP Upload/Download Programm, das aber z.B. bei der Anmeldung an den FTP-Server mit einem falschen Passwort abschmiert. Wie kann ich dem Programm beibringen bei ganz bestimmten Fehlern ganz bestimmte Dinge zu tun ?

Gruss nilsener

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:
procedure FTP_Abwicklung(steuerung : FTP_Platte);
Begin
transmission_flag:=true;
try Form1.NMFTP1.Connect;
 except
  on E: ESockError do
  begin
  MessageDlg('FTP-Host nicht erreichbar!', mtError, [mbOk], 0);
  end
 end;

if Form1.NMFTP1.Connected = True then
 begin
 Form1.NMFTP1.Mode(MODE_IMAGE);
 Form1.StatusBar1.SimplePanel := True;
 Form1.StatusBar1.SimpleText := 'FTP Remote Host Connected';
 Form1.StatusBar2.SimplePanel := True;
 Form1.StatusBar2.SimpleText := 'FTP Remote Host Connected';

 if steuerung = schreiben
  then Begin
       Form1.StatusBar1.SimpleText := 'FTP Remote Host Connected, Upload in progress.';
       Form1.StatusBar2.SimpleText := 'FTP Remote Host Connected, Upload in progress.';
       Form1.NMFTP1.upload('c:\test001.dat','test001.dat');
       end;
 if steuerung = laden
  then Begin
       Form1.NMFTP1.download('test001.dat','c:\test001.dat');
       Form1.StatusBar1.SimpleText := 'FTP Remote Host Connected, Download in progress.';
       Form1.StatusBar2.SimpleText := 'FTP Remote Host Connected, Download in progress.';
       end;
 end;
try Form1.NMFTP1.Disconnect; except end;
end;