PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Creating an archive
  • Creating an archive
zipCreate (Example)
Creating an archive
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)
The following code is used to create an archive. The name of the archive is entered in an edit control: EDT_ArchiveName. The path of the directory is selected by fSelectDir.
// Declare and initialize the variables
ArchiveName is string
ArchivePath is string
ResArchiveCreation is int
 
// Select the name of the archive. EDT_ArchiveName is edit control.
ArchiveName = EDT_ArchiveName
 
// Select the path of the archive
ArchivePath = fSelectDir("", "", "Selecting the directory")
 
// Create the "ArchiveName" archive
ResCreateArchive = zipCreate(ArchiveName, ...
CompleteDir(ArchivePath) + ArchiveName)
 
// Display an error message if the creation was not performed
IF ResArchiveCreation <> 0 THEN
Error(zipMsgError(ResArchiveCreation))
END
Creating an archive
Windows Mobile
The following code is used to create an archive. The name of the archive is entered in an edit control: EDT_ArchiveName.
// Declare and initialize the variables
ArchiveName is string
ArchivePath is string = "\Backups"
ResArchiveCreation is int
 
// Select the name of the archive. EDT_ArchiveName is edit control.
ArchiveName = EDT_ArchiveName
 
// Create the archive named "MyArchive"
ResCreateArchive = zipCreate(ArchiveName, ...
CompleteDir(ArchivePath) + ArchiveName)
 
// Display an error message if the creation was not performed
IF ResArchiveCreation <> 0 THEN
Error(zipMsgError(ResArchiveCreation))
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Criar , Adicionar, Fechar Zip
Exemplo Criar , Adicionar, Fechar Zip

_path_nome_zip is string="E:\aleva\Contador_Mandar\Arquivo.zip"
_arquivo_zip is zipArchive
n_cria_zip is int=zipCreate(_arquivo_zip,_path_nome_zip)
nResAddFile is int =0
IF n_cria_zip=0 THEN
//colocar os arquivos a ser compactados
s_nome_arquivo is string="E:\aleva\conferencia.txt"
//colocar os arquivos a ser compactados
//adicionando arquivo para zip com diretorio incluido
nResAddFile= zipAddFile(_arquivo_zip, s_nome_arquivo, zipDrive)
//
//adicionado arquivo somente
nResAddFile= zipAddFile(_arquivo_zip, s_nome_arquivo, zipNone)
END
zipClose(_arquivo_zip)

// Blog com Video e EXemplo

http://windevdesenvolvimento.blogspot.com.br/2016/10/aula-932-windev-zip-1.html

https://www.youtube.com/watch?v=yTTzvapkAUc
De matos
06 Oct. 2016