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
|
procedure TForm1.ConnectClick(Sender: TObject);
begin
FtpClient1.LocalFileName :=FILE_NAME_1;
FtpClient2.LocalFileName :=FILE_NAME_2;
Memo1.Clear;
try
FtpClient1.HostName := EdServ1.Text;
FtpClient1.UserName := EdUser1.Text;
// FtpClient1.Port :='21';
FtpClient1.PassWord := EdPsw1.Text;
FtpClient1.OnDisplay := displayhandler;
FtpClient2.HostName := EdServ2.Text;
FtpClient2.UserName := EdUser2.Text;
FtpClient2.PassWord := EdPsw2.Text;
FtpClient2.OnDisplay := displayhandler;
if FtpClient1.Connect then
Display('commande correcte')
else
Display('commande incorrecte');
if FtpClient2.Connect then
Display('la commande est correcte')
else
display('la commande est incorrecte');
FtpClient1.Passive := true ;
if FtpClient1.Passive then
Display('client 1 en mode passif');
{
if FtpClient2.LS then
Display('client 2 list');
if FtpClient1.LS then
Display('client 1 list');
}
ListBox1.Items.LoadFromFile(FILE_NAME_2);
// ListBox1.Items.Add(FtpClient2.LastResponse); |
Partager