BOOL CopyFile(    LPCTSTR lpExistingFileName, // pointer to name of an existing file 
    LPCTSTR lpNewFileName, // pointer to filename to copy to 
    BOOL bFailIfExists  // flag for operation if file exists 
   );
 

解决方案 »

  1.   

    使用FileCopy(PChar(SouFileName),PChar(DesFileName),bFailExist):Boolean;
    bFailExist:=false时目标文件已存在会覆盖,否则反之
      

  2.   

    对不起前面写反了应该是CopyFile
      

  3.   

    cppyfile 是在哪个单元中声明的?
      

  4.   

    使用系统Shell,拷贝文件,效果跟Windows得一样
    function CopyFileV2(s:string;d:string):integer;
    var
       SHF: TSHFileOpStruct;
    begin
       Result := -1;
       if NOT FileExists( s ) then
          Exit;
       With SHF do begin
          Wnd    := Application.Handle;
          wFunc  := FO_COPY;
          pFrom  := pChar( s + #0 );
          pTo    := pChar( d + #0 );
          fFlags :=FOF_FILESONLY ;
       end;
       Result := SHFileOperation( SHF );
    end;