Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Zipping files from inside VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Zipping files from inside VFP
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01222560
Message ID:
01222560
Vues:
138
I have qa need to implement a zip function in my application
This is the code I am using (not mine... don't remember where I got it from <bg>)
LOCAL lcZipFileName,lcDataPath
IF TYPE('oApp')='O'
	lcDataPath=oApp.DataLocn
ELSE 
	lcDataPath='DATA'
ENDIF 
lcZipFileName=ADDBS(lcDataPath)+'AFIles'+SYS(2015)+"_"+TTOC(DATETIME(),1)+".ZIP"
strtofile(chr(0x50)+chr(0x4B)+chr(0x05)+chr(0x06)+replicate(chr(0),18),lcZipFileName)
oShell=CREATEOBJECT("shell.application")
FOR EACH ofile IN oShell.NameSpace(lcDataPath).items
   oShell.NameSpace(cFileZip).copyhere(ofile)
ENDFOR
Code fails on NameSpace line
Error is: Member Namespace does not evaluate to an object.

Also, I only want to archive files that start 'A_'

How do I modify the code above to only include files of the above type?

TIA,
Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform