复制目录
procedure TForm1.Button1Click(Sender: TObject);
var
DirInfo: TSearchRec;
r : Integer;
begin
if SaveDialog1.Execute then
begin
if CreateDir(SaveDialog1.FileName)= false then
ShowMessage('不能创建目录:'+SaveDialog1.FileName);
r := FindFirst(ExtractFilePath(Application.Exename)+'dbf\*.*', FaAnyfile,
DirInfo);
while r = 0 do
begin
if ((DirInfo.Attr and FaDirectory <> FaDirectory) and
(DirInfo.Attr and FaVolumeId <> FaVolumeID)) then
CopyFile(pChar(ExtractFilePath(Application.Exename)+'dbf\'+DirInfo.Name),
pChar(SaveDialog1.FileName+'\'+DirInfo.Name),True);
r:=FindNext(DirInfo);
end;
SysUtils.FindClose(DirInfo);
end;
end;
|