使用文件拷贝函数就可以了。

解决方案 »

  1.   

    先找,再用CopyFile('SourceFile','DestinationFile',False);
    下面有一个找的例子procedure TForm1.Button1Click(Sender: TObject);
    var
      strFileName: string;            // holds the name of the file to find
      FindFileData: TWin32FindData;   // holds file information
      SearchHandle: THandle;          // holds the search handle
    begin
      {clear any listed files}  ListView1.Items.Clear;  {if there was no file specified, then specify all files}
      if Edit2.GetTextLen = 0 then Edit2.Text:= '*.*';  {construct the filename string}
      strFileName:= DirectoryListBox2.Directory + '\' + Edit2.Text;  {set the directory to the specified directory}
      SetCurrentDirectory(PChar(DirectoryListBox2.Directory));  {begin the search}
      SearchHandle:=FindFirstFile(PChar(strFileName), FindFileData);  {continue searching for all matching files in the current directory}
      if (SearchHandle <> INVALID_HANDLE_VALUE) then
      repeat
        ListView1.Items.Add.Caption:=FindFileData.cFileName;
      until (FindNextFile(SearchHandle,FindFileData) = FALSE);  {all files have been found, so close the search handle}
      Windows.FindClose(SearchHandle);
    end;