急!哪位大哥会做文件的备份、恢复,要多少分给多少分!

hongsushou 2001-08-30 07:22:43
我现在做了个数据库程序,要求有备份、恢复功能,现在有六个数据文件,怎样写到一个备份文件中,又怎样正确恢复呢?
...全文
123 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hongsushou 2001-08-30
  • 打赏
  • 举报
回复
谢谢copy_paste(木石三) ,先给30分!能不能自己设计算法,建立属于自己的文件呢?
copy_paste 2001-08-30
  • 打赏
  • 举报
回复
uses VCLUnZip, VCLZip;
好了,我知道的都给你啦。
copy_paste 2001-08-30
  • 打赏
  • 举报
回复
把下载的源程序copy to lib,还有sfx\*.bin
copy_paste 2001-08-30
  • 打赏
  • 举报
回复
下载VCLZIP控件(http://www.csdn.net/filebbs/read_topic.asp?id=499)
然后:

AZipName压缩后的文件名,AFilelist把你要压缩的文件加到里面。

function ZipFile(const AZipName: string; AFileList: TStrings): Boolean;
var
VCLZip: TVCLZip;
begin
VCLZip := TVCLZip.Create(nil);
Screen.Cursor := crHourGlass;
try
with VCLZip do
begin
DoProcessMessages := False;
ZipName := AZipName;
FilesList.Assign(AFileList);
StorePaths := True;
PackLevel := 9;
Zip;
Result := True;
end;
finally
VCLZip.Free;
Screen.Cursor := crDefault;
end;
end;

{AZipname是已经存在的zip文件,ADestDir将Zip文件解压的目录}
function UnZipFile(const AZipName, ADestDir: string): Boolean;
var
UnZipFile: TVCLUnZip;
begin
Result := False;
Screen.Cursor := crHourGlass;
UnZipFile := TVCLUnZip.Create(nil);
try
with UnZipFile do
begin
if not FileExists(AZipName) then
raise exception.create('not find file')
DestDir := ADestDir;
DoAll := True;
DoProcessMessages := True;
FlushFilesOnClose := False;
InCompleteZipMode := izAssumeMulti;
KeepZipOpen := False;
OverwriteMode := ifNewer;
RecreateDirs := False;
ReplaceReadOnly := False;
ZipName := AZipName;
UnZip;
Result := True;
end;
finally
UnZipFile.Free;
Screen.Cursor := crDefault;
end;
end;
hongsushou 2001-08-30
  • 打赏
  • 举报
回复
谁能说的详细些!最好有相关代码,要多少分都给!
qiangsheng 2001-08-30
  • 打赏
  • 举报
回复
用自己的格式写,反正没要求压缩。
copy_paste 2001-08-30
  • 打赏
  • 举报
回复
用VCLzip进行zip打包,解包可以不,xixi

33,010

社区成员

发帖
与我相关
我的任务
社区描述
数据结构与算法相关内容讨论专区
社区管理员
  • 数据结构与算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧