Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Example of extracting zipfile using DynaZip
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00664640
Message ID:
00664673
Vues:
20
>can anyone post example code of how they extract a zipfile using DynaZip ?

In addition to Fernando's post go to Download section and Download Mark McCasland DynaZip class. It's a wrapper of DynaZip Dll functions. Here is Extract program, which uses this class:
********************************************************************
*  Description.......: Extract - used for extracting files from ZIP archive
*  Calling Samples...: 
*  Parameter List....: tcDataDir, tcZipFile
*  Created by .......: Nadya Nosonovsky with Mark's comments
*  Modified by.......: Nadya Nosonovsky 04/27/2001 09:50:28 AM
********************************************************************
lparameters tcDataDir, tcZipFile
*!* vartype tests should always come first. if the parameter
*!* passed is not a character data type, the EMPTY() tests
*!* can give you an error.
if vartype(m.tcDataDir)<>'C' or empty(m.tcDataDir)	&& invalid parameter
	return .f.
endif
if vartype(m.tcZipFile)<>'C' or empty(m.tcZipFile)	&& invalid parameter
	return .f.
endif
tcZipFile = alltrim(m.tcZipFile)
if not file(m.tcZipFile)			&& invalid file or invalid path to file
	return .f.
endif
local oZip
oZip = newobject("DynaZip", "DynaZip.FXP")
with oZip
	.cUnz_ZipFile = m.tcZipFile
	.cUnz_FileSpec = "*.*"
	.cUnz_Destination = m.tcDataDir
*	.lUnz_OverWrite = .t.		&& not needed. these are the default values
	.lUnz_Quiet = .t.
*	.lUnz_NoDirNames = .t.		&& not needed. these are the default values
*	.lUnz_Recurse = .f.			&& not needed. these are the default values
*	.lUnz_NoDirItems = .t.		&& not needed. these are the default values
*	.lUnz_CryptFlag = .f.		&& not needed. these are the default values
*	.lUnz_CryptCode = ""		&& not needed. these are the default values
*	.dz_Unz_Function = 8		&& not needed. handled by UnzExtract method
	.lUSO_OverWrite_RO = .t.
	.lUSO_MinorCancel = .t.
	.lUSO_ExternalProg = .t.
	.lUSO_ExtProgCancel = .t.
	.cUnz_ExtProgTitle = "Extracting files from "+m.tcZipFile
	.lUnz_NoMsgs = .t.
	llSuccess = .UnzExtract()
	.release()
endwith
release oZip
return m.llSuccess
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform