I've been using BSZip for a year with great success. Even though I bought it, I
never received any documentation or link thereto.
Does anyone know how/if BS can do encryption? Sample VFP code would be greatly
appreciated.
Here is what I currently use:
=================================================
Lparameters tcFileName, tcZipFolder, tcFilesFolder
lnExists = ADIR(laFiles, tcFilesFolder + "*.*")
If lnExists = 0
Return .F.
Endif
Local I
****************** program variables
zFullTxt = "" && the FULL Path and file name of the file to zip
zTxtName = "" && the FILE Name only of the file to zip
zfn = "" && the name of the NEW Zip file we will create
zerr_no = 0 && test the valid status
item_num = 0 && number of items to be compressed
****************** end of variables
* Make Sure that is has a .zip extension!
zfn = tcZipFolder + tcFileName + ".zip"
clear dlls
declare integer zCreateNewZip in Libraries\BsZip string zipFileName
declare integer zOrderFile in Libraries\BsZip string zFullTxt, string zTxtName,
integer zUpdateMode
declare integer zCompressFiles in Libraries\BsZip string tmpdir, string zPass,
integer zCompressMethod, integer zResetArchiveAttribute, integer SpanSize,
string ZipComment, integer RTFunction
declare integer zCloseZipFile in Libraries\BsZip
declare string zGetLastErrorAsText in Libraries\BsZip
zerr_no = zCreateNewZip( zfn )
if zerr_no <> 0 && there was an error creating the zip file
wait window zGetLastErrorAsText()
return
endif
For i = 1 to alen(laFiles, 1)
zFullTxt = tcFilesFolder + laFiles( i, 1)
zTxtName = substr( zFullTxt, rat("\", zFullTxt) + 1)
if zOrderFile( zFullTxt, zTxtName, 0) = 0
item_num = item_num + 1
Endif
Endfor
* Do compression
if item_num > 0
zerr_no = zCompressFiles("", "", 2, .f., 0, "", 0) && Normal Compression
if zerr_no <> 0
wait window zGetLastErrorAsText()
Endif
Endif
=zCloseZipFile()
clear dlls
Return .T.
=================================================
Thanks,
Henry
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.