home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 32
/
hot34.iso
/
ficheros
/
9ZIP
/
TSUZDLL.ZIP
/
EXAM1
/
FUNZIP.PRG
Wrap
Text File
|
1998-04-06
|
2KB
|
62 lines
* (c) TopSpeedSoft 1998
* This is a example of using TopSpeed Unzip DLL for Windows 95 from Visual FoxPro
*
* Compile it with Visual FoxPro 5.0
*
*This example opens zip file, shows its contents
*and test its integrity. Be sure TSUZ.DLL is
*available in directory.
* the path/name of zip file to be tested
* change it to your zip file name
zfn = 'C:\temp\tst\x.zip'
* declaring importing functions
declare integer zOpenZipFile in tsuz string zipfilename
declare integer zCloseZipFile in tsuz
declare integer zGetTotalFiles in tsuz
declare string zGetFileName in tsuz integer item
declare integer zGetFileSize in tsuz integer item
declare string zGetLastErrorAsText in tsuz
declare string zGetLastOperResult in tsuz integer item
declare integer zExtractAll in tsuz string extractdir, string pswd, integer OverwriteExisting, integer UseFolders, integer TestOnly, integer RTInfoFunc
? 'Simple Example how to use TopSpeed Unzip DLL for Windows 95'
*open zip file
if zOpenZipFile(zfn) <> 0
*if there is an error, show it and exit
? 'Error: ' + zGetLastErrorAsText()
return
endif
*get number of items in zip file
num_items = zGetTotalFiles()-1;
*iterate on list of items and show file name and file size
for i = 0 to num_items do
? str(i,4)+' '+zGetFileName(i)+' '+str(zGetFileSize(i),12)
endfor
wait window 'Press a key to continue...'
*test integrity of all files
if zExtractAll('','',.F.,.F.,.T.,0) <> 0
*if there is an error, show it and exit
? 'Error: ' + zGetLastErrorAsText()
return
endif
*show report
for i = 0 to num_items do
? str(i,4)+' '+zGetFileName(i)+' '+zGetLastOperResult(i)
endfor
=zCloseZipFile()
wait window 'Press a key to continue...'