我不想用什么命令行程序,可以考虑用控件或dll什么的,大家帮帮忙忙啊,分不够可以再加

解决方案 »

  1.   

    可以用VCLZIP控件,用法比较简单,去www.2ccc.com下载
      

  2.   

    要功能强大一点支持多种格式的就用ZipTV吧
      

  3.   

    VCLZip既然是VCL就肯定有BCB版的,去www.ccrun.com找找
      

  4.   

    VCLZip控件
    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;
      

  5.   

    function UnZipFile(DesPathName, ZipFileName: string; OverWrite: Boolean;
      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;