if copyfile('c:\123.ndb','d:\456.mdb',true) then showmessage('ok');
编译时就错

解决方案 »

  1.   

    Delphi里面有在个函数吗?我怎么没见过:copyfile
      

  2.   

    uses 段包含了Windows没有?
    我这里可以通过编译!
      

  3.   

    string 转 pchar
    怎么转?
      

  4.   

    刚才找到copyfile的定义
    unit FmxUtils;procedure CopyFile(const FileName, DestName: string);
    只有两个参数!
      

  5.   

    string 转 pchars:string;
    pc:pchar;pc:=pchar(s);
      

  6.   

    copyfile()应该有三个参数!比如
    copyfile('d:\aa.txt','e:\aa.txt',true);
    我想你的问题应该没有错啊,我的能够编译!!
      

  7.   

    我知道我的问题了
    copyfile('d:\aa.txt','e:\aa.txt',true);
    是没有错误的
    但我是想用变量
    例如:
    var s1,s2 : pchar;
    s1:='c:\aa.txt';
    s2:='d:\bb.txt';
    copyfile(s1,s2,true);
    但为什么不行呢?