G
gzbxmcx
Unregistered / Unconfirmed
GUEST, unregistred user!
连接一切正常情况下,一执行到:FIdFtp.Get(self.FileName, FileName, True);就不动了。
procedure TFTPTransfer.Connect;
begin
try
FIdFtp.Host := self.Host;
FIdFtp.Username := self.User;
FidFtp.Password := self.Password;
FIdFtp.Port := self.Port;
FIdFtp.Connect(True);
if (FidFtp.Username <> 'Anonymous') then
FIdFtp.Login;
except
raise;
end;
end;
procedure TFTPTransfer.Get(FileName: String);
begin
try
if (not FIdFTP.Connected) then
Connect();
FIdFtp.Passive := True;
FIdFtp.ChangeDir(self.CurrentDir);//一切正常。
FIdFtp.Get(self.FileName, FileName, True);//这句死锁!
FIdFtp.Disconnect;
except
raise;
end;
end;
procedure TFTPTransfer.Connect;
begin
try
FIdFtp.Host := self.Host;
FIdFtp.Username := self.User;
FidFtp.Password := self.Password;
FIdFtp.Port := self.Port;
FIdFtp.Connect(True);
if (FidFtp.Username <> 'Anonymous') then
FIdFtp.Login;
except
raise;
end;
end;
procedure TFTPTransfer.Get(FileName: String);
begin
try
if (not FIdFTP.Connected) then
Connect();
FIdFtp.Passive := True;
FIdFtp.ChangeDir(self.CurrentDir);//一切正常。
FIdFtp.Get(self.FileName, FileName, True);//这句死锁!
FIdFtp.Disconnect;
except
raise;
end;
end;