每次只输出一个文件 我用循环语句 选择多个发送文件的时候报错 好像没有发现文件 求各位帮帮忙看看! procedure TMainForm.UploadButtonClick(Sender: TObject); var i: Integer; begin for i := 0 to (FileListBox1.Items.Count - 1) do begin try if FileListBox1.Selected[i] then begin if IdFTP1.Connected then begin SetFunctionButtons(false); IdFTP1.TransferType := ftBinary; IdFTP1.Put(FileListBox1.Items[i].text);//用这行代码就报错 IdFTP1.Put(FileListBox1.FileName, ExtractFileName(FileListBox1.FileName));//用这行代码只能发送一个文件 ChageDir(idftp1.RetrieveCurrentDir); SetFunctionButtons(true); end end; finally { do something here } end; end; end;
----------------------------------------------
-