用copyfile函数不能判断拷贝的进度吧,如果一定要用progressbar那就改用readfile,writefile,filesize可以通过文件的大小,但前复制的位置来判断进度。

解决方案 »

  1.   

    var
      sourcefile,destfile:file;
      i,j:integer;
      p:array[0.1] of char;
    begin
       assignfile(sourcefile,rbedit1.Text);
       reset(sorcefile,1);
       assignfile(destfile,rbedit2.Text);
       rewrite(destfile,1);
       ProgressBar1.posotion:=0;
       repeat
            blocaread(sourcefile,p,sizeof(p),i);
            blocawrite(destfile,p,sizeof(p),j);
            ProgressBar1.posotion:=ProgressBar1.posotion+2;
       until (i=0 or i<>j)
       closefile(sourcefile);
       closefile(destfile);
    end;