le Code pour afficher le contenu d'un LZH fichier.
Contributeur: SWAG ÉQUIPE de SUPPORT
le Programme de lzhview
Utilise
Dos, Crt
Const
BSize = 4096 { I/S Taille de la mémoire Tampon }
Type LZHHead = Enregistrement
HSize : Octet
Fill1 : Octet
Méthode : Array[1..5] de Char
CompSize : LongInt
UCompSize : LongInt
Dos_DT : LongInt
Fill2 : Mot
FileNameLen: Octet
nom du fichier : Array[1..12] de Char
fin
Var LZH1 : LZHHead
DT : DateTime
FSize,L,C : LongInt
F : Fichier
BUFF : Tableau[1..BSize] of Byte
DATE : String[8] { formaté date AA/MM/JJ }
HEURE : String[6] { ' heure sous la forme HH:MM }
RES : Mot
DIR : DirStr
FNAME : NameStr
EXT : ExtStr
LZHString,
SName : String
QUIT : Boolean
SW : Pointeur
la Fonction upper(st:String):String
Var i : Integer
begin
For i := 1 to length(st) ne st[i] :=upcase(st[i])
tige := st
fin
la Fonction ord_to_str(i:LongInt j:Byte):String
Var c:String
begin
str(i,c)
Tout en longueur(c) 0, alors
begin
Move (FileNameLen,SNOM,FileNameLen 1)
UnPackTime (Dos_DT,DT)
FSize := CompSize
fin
d'autre QUIT := True
end { GET_LZH_ENTRY }
Procédure DO_LZH (FN : String)
Var fnstr, LZHMeth : String
fls,totu,totc : LongInt
begin
totu:=0 totc:=0 fls:=0
Assign (F,FN)
{$I-} Reset (F,1) {$I }
si Ioresult<>0 then
begin
Writeln(en haut(FN) & #39 pas trouvé & #39 )
Sortie
fin
FSize := FileSize(F)
C := 0
QUIT := False
Writeln( & #39 LZH Fichier : & #39 supérieure(FN))
Writeln
Writeln( & #39 nom de fichier OrigSize CompSize Méthode Date & #39
& #39 Fois & #39 )
Writeln( & #39 & & & & & & & & & & & & & & & & & & & & & & & #39
& #39 & & & & #39 )
Repeat
GET_LZH_ENTRY
si ne pas QUITTER, puis
begin
FSplit (SNAME,DIR,FNAME,EXT)
fnstr:=FNAME EXT
Tout en longueur(fnstr)<12 insérer( & #39 & #39 ,fnstr,longueur(fnstr) 1)
FDT(LZH1.Dos_DT)
inc(totu,lzh1.ucompsize)
inc(totc,lzh1.compsize)
inc(fls,1)
Cas LZH1.Méthode[4] of {normalement seulement 0,1 ou 5}
& #39 0 & #39 : LZHMeth:= & #39 Stockées & #39
& #39 1 & #39 : LZHMeth:= & #39 Congelés 1 & #39
& #39 2 & #39 : LZHMeth:= & #39 Surgelés 2 & #39
& #39 3 & #39 : LZHMeth:= & #39 Surgelés 3 & #39
& #39 4 & #39 : LZHMeth:= & #39 Surgelés 4 & #39
& #39 5 & #39 : LZHMeth:= & #39 Congelé 5 & #39
d'autre LZHMeth:= & #39 Inconnu & #39
fin
LZHString:=Fnstr & #39 & #39 ord_to_str(LZH1.UCompsize,8) & #39 & #39
ord_to_str(LZH1.Compsize,8) & #39 & #39 lzhmeth & #39 & #39
DATE & #39 & #39 FOIS
Writeln(LZHString)
fin
Inc (C,FSize LZH1.HSize 2)
Jusqu'à ce que QUITTER
Close (F)
Writeln( & #39 & & & & & & & & & & & & & & & & & & & & & & & #39
& #39 & & & -#39 )
Writeln(ord_to_str(fls,5) & #39 Fichiers & #39 ord_to_str(totu,8) & #39 & #39
ord_to_str(totc,8))
end { DO_LZH }
begin
ClrScr
do_lzh( & #39 quoi que ce soit.lzh & #39 ) { < & lieu le nom de fichier ici }
à la fin.
Lzw spectateur
Lzw spectateur : Plusieurs milliers de conseils pour vous faciliter la vie.
le Code pour afficher le contenu d'un LZH fichier.
Contributeur: SWAG EQUIPE de SUPPORT
le Programme de lzhview
Utilise
Dos, Crt
Const
BSize = 4096 { I/S Taille de la memoire Tampon }
Type LZHHead = Enregistrement
HSize : Octet
Fill1 : Octet
Methode : Array[1..5] de Char
CompSize : LongInt
UCompSize : LongInt
Dos_DT : LongInt
Fill2 : Mot
FileNameLen: Octet
nom du fichier : Array[1..12] de Char
fin
Var LZH1 : LZHHead
DT : DateTime
FSize,L,C : LongInt
F : Fichier
BUFF : Tableau[1..BSize] of Byte
DATE : String[8] { formate date AA/MM/JJ }
HEURE : String[6] { ' heure sous la forme HH:MM }
RES : Mot
DIR : DirStr
FNAME : NameStr
EXT : ExtStr
LZHString,
SName : String
QUIT : Boolean
SW : Pointeur
la Fonction upper(st:String):String
Var i : Integer
begin
For i := 1 to length(st) ne st[i] :=upcase(st[i])
tige := st
fin
la Fonction ord_to_str(i:LongInt j:Byte):String
Var c:String
begin
str(i,c)
Tout en longueur(c) 0, alors
begin
Move (FileNameLen,SNOM,FileNameLen 1)
UnPackTime (Dos_DT,DT)
FSize := CompSize
fin
d'autre QUIT := True
end { GET_LZH_ENTRY }
Procedure DO_LZH (FN : String)
Var fnstr, LZHMeth : String
fls,totu,totc : LongInt
begin
totu:=0 totc:=0 fls:=0
Assign (F,FN)
{$I-} Reset (F,1) {$I }
si Ioresult<>0 then
begin
Writeln(en haut(FN) & #39 pas trouve & #39 )
Sortie
fin
FSize := FileSize(F)
C := 0
QUIT := False
Writeln( & #39 LZH Fichier : & #39 superieure(FN))
Writeln
Writeln( & #39 nom de fichier OrigSize CompSize Methode Date & #39
& #39 Fois & #39 )
Writeln( & #39 & & & & & & & & & & & & & & & & & & & & & & & #39
& #39 & & & & #39 )
Repeat
GET_LZH_ENTRY
si ne pas QUITTER, puis
begin
FSplit (SNAME,DIR,FNAME,EXT)
fnstr:=FNAME EXT
Tout en longueur(fnstr)<12 inserer( & #39 & #39 ,fnstr,longueur(fnstr) 1)
FDT(LZH1.Dos_DT)
inc(totu,lzh1.ucompsize)
inc(totc,lzh1.compsize)
inc(fls,1)
Cas LZH1.Methode[4] of {normalement seulement 0,1 ou 5}
& #39 0 & #39 : LZHMeth:= & #39 Stockees & #39
& #39 1 & #39 : LZHMeth:= & #39 Congeles 1 & #39
& #39 2 & #39 : LZHMeth:= & #39 Surgeles 2 & #39
& #39 3 & #39 : LZHMeth:= & #39 Surgeles 3 & #39
& #39 4 & #39 : LZHMeth:= & #39 Surgeles 4 & #39
& #39 5 & #39 : LZHMeth:= & #39 Congele 5 & #39
d'autre LZHMeth:= & #39 Inconnu & #39
fin
LZHString:=Fnstr & #39 & #39 ord_to_str(LZH1.UCompsize,8) & #39 & #39
ord_to_str(LZH1.Compsize,8) & #39 & #39 lzhmeth & #39 & #39
DATE & #39 & #39 FOIS
Writeln(LZHString)
fin
Inc (C,FSize LZH1.HSize 2)
Jusqu'a ce que QUITTER
Close (F)
Writeln( & #39 & & & & & & & & & & & & & & & & & & & & & & & #39
& #39 & & & -#39 )
Writeln(ord_to_str(fls,5) & #39 Fichiers & #39 ord_to_str(totu,8) & #39 & #39
ord_to_str(totc,8))
end { DO_LZH }
begin
ClrScr
do_lzh( & #39 quoi que ce soit.lzh & #39 ) { < & lieu le nom de fichier ici }
a la fin.