to cbdelphi :<br> 我帮你做好了~~~<br> 假设你原来的目录为 c:/tyn1 你现在想备份到 c:/tyn2目录下<br>~~~~~~<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> FileOpStruct :TSHFileOpStruct;<br> Buf1 :array [0..127] of Char;<br> Buf2 :array [0..127] of Char;<br> Str1,Str2 :String;<br>begin<br> Str1 :='c:/tyn1';<br> Str2 :='c:/tyn2';<br> FillChar(Buf1,SizeOf(Buf1),0);<br> FillChar(Buf2,SizeOf(Buf2),0);<br> StrPCopy(Buf1,Str1);<br> StrPCopy(Buf2,Str2);<br> with FileOpStruct do<br> begin<br> Wnd :=Handle;<br> wFunc :=FO_COPY;<br> pFrom :=@Buf1;<br> pTo :=@Buf2;<br> fFlags :=FOF_SIMPLEPROGRESS;<br> fAnyOperationsAborted :=False;<br> hNameMappings :=nil;<br> lpszProgressTitle :='拷贝文件';<br> end;<br> SHFileOperation(FileOpStruct);<br>end;