我不想用什么命令行程序,可以考虑用控件或dll什么的,大家帮帮忙忙啊,分不够可以再加
解决方案 »
- Procedure, 求至少3个极简单的例子和实例~急急~
- 怎样写代码?动态生成下面这种多排(行)控件,然后在用户对checkbox多选时将选择结果组合并保存到数据库
- 我的网站上falsh跑的飞快
- 请教:在Delphi6中如何调用AdoConnection的Build Connection String的数据链接属性对话框?
- 请教动态实现系统托盘?
- Toolbar怎么把文字设置上去?
- 为什么我用ADOConnection的ODBC不能访问dBase,paradox等类型的数据库啊?请问如何写驱动呢?谢谢
- 学delphi应该怎样学?
- 问一个查询的问题,很简单的
- 滚动条的一个疑问!?
- ado问题
- 请问DELPHI IDE自动加入到窗体中控件属性是public?
function ZipFile(SrcPathName, ZipFileName: string; OverWrite: Boolean;
IsDir: Boolean; sPwd: string): Boolean;
var
VCLZip: TVCLZip;
ZFileList: TStringList;
begin
Result := False;
ZFileList := TStringList.Create;
VCLZip := TVCLZip.Create(nil);
try
if IsDir and (not DirectoryExists(SrcPathName)) then
MkDir(SrcPathName);
ZFileList.Text := SrcPathName;
with VCLZip do
try
Password := sPwd;
DoProcessMessages := True;
DoAll := True;
if OverWrite then
begin
OverwriteMode := Always;
ZipAction := zaReplace;
end else begin
OverwriteMode := Never;
ZipAction := zaUpdate;
end;
FlushFilesOnClose := True;
if IsDir then
RootDir := SrcPathName
else
RootDir := ExtractFilePath(SrcPathName);
FilesList.Clear;
if IsDir then
FilesList.Add('*.*')
else
FilesList.Assign(ZFileList);
RelativePaths := True;
ZipName := ZipFileName;
Zip;
Result := True;
except
Result := False;
end;
finally
VCLZip.Free;
ZFileList.Free;
end;
end;
IsDir: Boolean; sPwd: string): Boolean;
begin
Result := False;
if IsDir and (not DirectoryExists(DesPathName)) then
MkDir(DesPathName);
if IOResult <> 0 then Exit;
if not FileExists(ZipFileName) then Exit;
with TVCLUnZip.Create(nil) do
try
try
Password := sPwd;
DoProcessMessages := True;
ZipName := ZipFileName;
ReadZip;
if Count = 0 then Abort; // 没有文件的情况 zmj
DestDir := DesPathName;
DoAll := True;
RecreateDirs := True;
if OverWrite then
OverwriteMode := ifNewer
else
OverwriteMode := Never;
UnZip;
Result := True;
except
Result := false;
end;
finally
Free;
end;
end;