高分,求源码! 怎样从FTP服务器上拷文件到本地上,
解决方案 »
- 新手求教~小問題~
- 第十一期:CSDN论坛秀-Delphi版-本期作秀:hkbarton(→Beginner←)
- 菜鸟问题-举手之劳
- 给一家公司做软件,大家说说该收多少钱?
- delphi7程序,如何在程序里作设置操作系统日期的短格式为yyyy-mm-dd形式?要求支持w98/2000/xp/2003系统的
- 实在不知道就问
- 老问题-----------------再线等
- 有两个文本框,我想进入第一个进,输入法能自动切换成中文输入,进入第二个则变成英亠乂输入,怎么做?我试了半天都没做成,谢谢。
- 如何得到TGraphicControl或其子类实例的句柄
- 怎么用webbrower自动填写表单???
- DBGrid中数据读取的问题
- ACCESS数据库连接出现的问题!
begin
ConnectButton.Enabled := false;
if IdFTP1.Connected then
try
if TransferrignData then IdFTP1.Abort;
IdFTP1.Quit;
finally
DirectoryListBox.Items.Clear;
ConnectButton.Caption := '连接';
ConnectButton.Enabled := true;
ConnectButton.Default := true;
end
else
try
IdFTP1.User := UserIDEdit.Text;
IdFTP1.Password := PasswordEdit.Text;
IdFTP1.Host := FtpServerEdit.Text;
IdFTP1.Port:=StrtoInt(PortEdit.Text);
IdFTP1.Connect;
DirectoryListBox.Items.Clear;
IdFTP1.List(DirectoryListBox.Items);
finally
ConnectButton.Enabled := true;
if IdFTP1.Connected then
begin
ConnectButton.Caption := '断开';
ConnectButton.Default := false;
end;
end;end;procedure TForm1.UsePassiveClick(Sender: TObject);
begin
IdFTP1.Passive := UsePassive.Checked;
end;procedure TForm1.DownloadButtonClick(Sender: TObject);
var fileName:string;
begin
if Not IdFTP1.Connected then exit;
Filename:=Trim(Midstr(DirectoryListBox.Items[DirectoryListBox.ItemIndex],40,90));
IdFTP1.TransferType := ftBinary;
BytesToTransfer := IdFTP1.Size(FileName);
IdFTP1.Get(FileName, EditPath.Text+FileName, true);
end;