Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Zipping in VFP
Message
De
26/05/2006 18:24:39
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01125311
Message ID:
01125431
Vues:
115
I tried Yuri's suggestion... VERY COOL and FREE! WinZip will open the files if you need to verify the results. I also noticed it compressed the subdirectories as well. I don't know if you can do single files, but if you can create a directory and compress just that directory it works great.
*To zip file

cFileZip = "C:\temp2\D401001F.ZIP"
cSource = "c:\temp1\"
strtofile(chr(0x50)+chr(0x4B)+chr(0x05)+chr(0x06)+replicate(chr(0),18),cFileZip)
o=CREATEOBJECT("shell.application")
FOR EACH ofile IN o.NameSpace(cSource).items
o.NameSpace(cFileZip).copyhere(ofile)
ENDFOR


*Unzip files 


cFileZip = "C:\temp\D401001F.ZIP"
cDestination = "c:\temp\"

o=CREATEOBJECT("shell.application")
FOR EACH ofile IN o.NameSpace(cFileZip).items
o.NameSpace(cDestination).copyhere(ofile)
ENDFOR
>I need to incorporate zipping into an app in vfp 9. I have used several things in the past, but wanted feedback on what users have done lately. It has been a while since I had to incorporate this functionality.
>
>TIA!
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform