请大家帮帮忙,关于ZipTV密码.请大家指点,指点!急.

a378270896 2008-02-07 01:26:16
我是新手,正在用ZipTV里的unrar控件编一可以解压缩带密码的.rar文件.可是不知道应该怎么处理密码的问题,请大家帮帮忙,先谢谢大家.
程序如下:
if OpenDialog1.Execute then
begin
UnRar1.ArchiveFile:=OpenDialog1.FileName;
UnRar1.ExtractDir:='c:\aa';
UnRar1.FileSpec.Add('*.*');
UnRar1.RecurseDirs:=True;
ShowMessage(IntToStr(UnRar1.Extract));
但是密码应该怎么输入程序,如果密码不正确的话又会返回什么参数.
大家帮帮忙.想了快一星期了,头都大了.
...全文
112 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
僵哥 2008-02-14
  • 打赏
  • 举报
回复
或者可以参考Demo:
(*
This demo was updated to support unicode and the TNT unicode controls.

See ..\unicode_notes.txt for usage notes on the TNT_UNICODE
conditional define (the file is in [ziptv install dir]\demos).

*)
Unit Unit1;

Interface

Uses
Windows,
Messages,
SysUtils,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls,

ztvRegister,
ztvBase,
ztvConsts, // _String unicode
ztvUnRar,
ztvGbls;

Type
TForm1 = Class(TForm)
Button1: TButton;
UnRAR1: TUnRAR;
CheckBox1: TCheckBox;
Button2: TButton;
Procedure Button1Click(Sender: TObject);
{$ifdef TNT_UNICODE}
Procedure UnRar1GetPassword(Sender: TObject; FileName: WideString;
Var Password: String; Var HeaderKeys, DataKeys: TSeedKeyRecord;
Var TryAgain: Boolean);
{$else}
Procedure UnRar1GetPassword(Sender: TObject; FileName: String;
Var Password: String; Var HeaderKeys, DataKeys: TSeedKeyRecord;
Var TryAgain: Boolean);
procedure Button2Click(Sender: TObject);
{$endif TNT_UNICODE}
Private
{ Private declarations }
Public
{ Public declarations }
End;

Var
Form1: TForm1;

Implementation

{$R *.DFM}


//-------------------------------------------------------------

Procedure TForm1.Button1Click(Sender: TObject);
Begin
UnRAR1.ArchiveFile := 'd:\3\rar\exes.rar';
UnRAR1.ExtractDir := 'c:\hold1\';
UnRAR1.UseStoredDirs := CheckBox1.Checked;
UnRAR1.DateAttribute := daFileDate;
UnRAR1.ConfirmOverwrites := False;
UnRAR1.OverwriteMode := omOverwrite;
UnRAR1.RestoreFileAttr := False;
UnRAR1.CreateStoredDirs := False;
UnRAR1.TranslateOemChar := True;
UnRAR1.RecurseDirs := True;
UnRAR1.VolumeName := '';
UnRAR1.FileSpec.Clear();
//unRar1.FileSpec.Add('SRC\ATL.CPP');
UnRAR1.FileSpec.Add('*.*');
UnRAR1.RecurseDirs := True;
UnRAR1.Extract();
ShowMessage(IntToStr(UnRAR1.Count));
End;
//-------------------------------------------------------------

Procedure TForm1.UnRar1GetPassword(Sender: TObject; FileName: _String;
Var Password: String; Var HeaderKeys, DataKeys: TSeedKeyRecord;
Var TryAgain: Boolean);
Begin
//Password := '-0-OSPREY-0-RAID-0-';
End;
//-------------------------------------------------------------

procedure TForm1.Button2Click(Sender: TObject);
begin
UnRar1.Cancel := True;
end;

End.
僵哥 2008-02-14
  • 打赏
  • 举报
回复
UnRar1.Password:='******';
a378270896 2008-02-07
  • 打赏
  • 举报
回复
不好意思,分没加进去,如果大家帮我解决了问题一定给加分.
站里以前那个 6.8.4 是编译不了的。ZipTV 6.8.4 for Delphi 4, 5, 6 and 7 with source codeYOU MAY USE THIS RELEASE FOR EVALUATION PURPOSES ONLY!SOFTWARE COMPANIES NEED SUPPORT FOR QUALITY PRODUCTS.YOU ARE NOT ALLOWED TO USE THIS RELEASE TO MAKE MONEYOR USE IT FOR ANY OTHER COMMERCIAL PURPOSES.IF YOU LIKE THIS SOFTWARE: BUY IT!INSTALLATION============Extract the contents of the archive to a directory of your choice. Start Delphi. Close all open projects.Add the location of the ZipTV Source folder to the Library path: - From the menu choose: Tools -> Environment Options - In the Environment Options window click on the Library tab - Add the location to the source folder to the Library path - Click OKCompile the run-time package: - From the menu choose: File -> Open - Navigate to the ZipTV Source folder - Open the run-time package file: ztv#0rt.dpk (replace # with your Delphi version number) You will see a warning: "Cannot find resource file: ztv#0rt.res. Recreated." Click: OK - Click: Compile This will create the file ztv#0rt.bpl in your delphiin folder - Close the window - Copy the file ztv#0rt.bpl from delphiin to windowssystem (or windowssystem32 depending on your Windows version)Install the design-time package: - From the menu choose: File -> Open - Navigate to the ZipTV Source folder - Open the design-time package file: tziptv#.dpk (replace # with your Delphi version number) You will see a warning: "Cannot find resource file: tziptv#.res. Recreated." Click: OK - Click: Install The following four tabs will be added to your component palette: ZTV Compress ZTV Decompress ZTV Tools ZTV Volumes - Close the windowEnjoy :)

16,743

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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