复制目录:<br>///复制Source整个目录到DEST目录,如果Dest不存在,自动建立,如果DEST存在,那么Source将作为Dest的子目录!<br>//例如如果要复制E:/Temp整个目录到E:/那么代码为: copydirectory('e:/temp','e:/');<br>///如果要复制E:/Temp到E:/Test目录下面,那么代码为:CopyDirecotry('E:/Temp','E:/TEST');<br>function CopyDirectory(const Source, Dest: string): boolean;<br>var<br> fo: TSHFILEOPSTRUCT;<br>begin<br> FillChar(fo, SizeOf(fo), 0);<br> with fo do<br> begin<br> Wnd := 0;<br> wFunc := FO_COPY;<br> pFrom := PChar(source+#0);<br> pTo := PChar(Dest+#0);<br> fFlags := FOF_NOCONFIRMATION+FOF_NOCONFIRMMKDIR ;<br> end;<br> Result := (SHFileOperation(fo) = 0);<br>end;<br><br>----------<br>CopyFile(PChar('源文件路径'),PChar('目标文件路径'),false);