煮
煮草论酒
Unregistered / Unconfirmed
GUEST, unregistred user!
我用TIdFTP控件编写的连接FTP服务器的程序,为什么当超时时就直接停止程序了,请帮我看看这个过程有什么问题,谢谢
procedure connect_ftp;
begin
try
if not Form1.IdFTP1.Connected then
Form1.IdFTP1.Connect(True,-1);
if Form1.IdFTP1.Connected then
begin
Form1.IdFTP1.Disconnect;
Form1.IdFTP1.Abort;
Form1.IdFTP1.Quit;
end;
except
on e:exception do
begin
showMessage(e.Message);
Form1.IdFTP1.Free;
end;
end;
end;
procedure connect_ftp;
begin
try
if not Form1.IdFTP1.Connected then
Form1.IdFTP1.Connect(True,-1);
if Form1.IdFTP1.Connected then
begin
Form1.IdFTP1.Disconnect;
Form1.IdFTP1.Abort;
Form1.IdFTP1.Quit;
end;
except
on e:exception do
begin
showMessage(e.Message);
Form1.IdFTP1.Free;
end;
end;
end;