怎样 让程序 自己复制自己

解决方案 »

  1.   

    copyfile(pchar(getcurrentdir+Application.Exename),'你要保存复制文件的路径',false);
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      s : string;
    begin
      s := getcurrentdir+'\'+extractfilename(Application.Exename);
      copyfile(pchar(s),pchar('d:\d.exe'),false);
    end;
      

  3.   

    哎,脑子不好使了,直接
    copyfile(pchar(application.exename),pchar('d:\d.exe'),false);
    就可以了