我来给你答案吧。<br>你需要在窗体上加个TProgressBar控件<br>Procedure TForm1.CopyFileWithProgressBar(Source,Destination : string);<br><br>var<br><br>FromF,ToF : file of byte;<br><br>Buffer : array[0..4096] of char;<br><br>NumRead : integer;<br><br>FileLength : longint;<br><br><br>begin<br><br>AssignFile(FromF,Source);<br><br>reset(FromF);<br><br>AssignFile(ToF,Destination);<br><br>rewrite(ToF);<br><br>FileLength:=FileSize(FromF);<br><br>With Progressbar1 do<br><br>begin<br><br>Min := 0;<br><br>Max := FileLength;<br><br>while FileLength > 0 do<br><br>begin<br><br>BlockRead(FromF,Buffer[0],SizeOf(Buffer),NumRead);<br><br>FileLength := FileLength - NumRead;<br><br>BlockWrite(ToF,Buffer[0],NumRead);<br><br>Position := Position + NumRead;<br><br>end;<br><br>CloseFile(FromF);<br><br>CloseFile(ToF);<br><br>end;<br><br><br>procedure TForm1.Button1Click(Sender: TObject);<br><br>begin<br><br>CopyFileWithProgressBar('c:/Windows/Welcome.exe','c:/temp/Welcome.exe');<br><br>end;<br>