ciao a tutti. utilizzo ziplib per creare dei file zip in vb.net e fin qui non ho problemi.

Ora pero' devo aggiungere un file a un archivio .zip gia esistente, ho creato questa procedura:


Public function Comprimi(byval sourceFile as String, byval destinationFile as String) as Boolean
try
Dim objCrc32 As New Crc32
dim zippa as ZipOutputStream
'Creo il file zip se non esiste altrimenti lo apro per aggiornarlo
if my.Computer.FileSystem.FileExists(destinationfile) = False then
zippa = New ZipOutputStream(File.Create(destinationFile))
else
zippa = New ZipOutputStream(File.Open(destinationFile, FileMode.Append))
end if

zippa.SetLevel(7)


dim fs as FileStream = file.OpenRead(sourcefile)

dim buffer as Byte () = New Byte(fs.Length) {}

objcrc32.Reset

dim myEntry as ZipEntry = new ZipEntry(sourcefile)

zippa.PutNextEntry(myentry)


Dim byteread As Integer

while fs.Position < fs.Length
byteread = fs.read(buffer,0,buffer.Length)
zippa.Write(buffer, 0, byteread)
objcrc32.Update(buffer,0,byteread)
End While
myentry.Crc = objcrc32.Value



'chiudo gli stream e gli entry
zippa.CloseEntry()
fs.Close
zippa.Finish
zippa.Close

'Ritorno true per la procedura
return True

Catch ex As Exception
MessageBox.Show(ex.Message, "Errore: ", MessageBoxButtons.OK, MessageBoxIcon.Error)
return False
End Try

End Function


sembrerebbe tutto ok, solo che quando vado ad aggiornare il file .zip invece che aggiungermi il file mi elimina quelli precedentemente contenuti e quindi mi ritrovo sempre solo l'ultimo file.

qualcuno sa come si fa ad aggiungere i file?

grazie