if SaveDialog1.Execute then
begin
Distin1 := Copy(SaveDialog1.FileName,1,Length(SaveDialog1.FileName)-4);
Distin2 := Copy(SaveDialog1.FileName,Length(SaveDialog1.FileName)-4,Length(SaveDialog1.FileName));
FillChar(FromBuf,SizeOf(FromBuf),0);
FillChar(ToBuf,SizeOf(ToBuf),0);
StrPCopy(FromBuf,PChar(FileName+'/data'));
StrPCopy(ToBuf,PChar(distin1));
with OpStruc do
begin
Wnd := Handle;
wFunc := FO_COPY;
pFrom := @FromBuf;
pTo := @ToBuf;
fFlags := FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
fAnyOperationsAborted := False;
hNameMappings := nil;
lpszProgressTitle := nil;
end;
SHFileOperation(OpStruc);
用整目录拷贝过去