I am using the following code to create a zip file and I have installed the ICSharpCode.SharpZipLib.dll
When trying to extract the files using windows extracter, I get a blocking error that says to bring up the properties of the zip folder and
click on unblock. When this is done, the folder still won't open. I can extract the files using winzip! Can anyone enlighten me on what to do.
And does someone have some VB.net code to creat a self-extracting file that contains zip files?
Dim strmZipOutputStream As ZipOutputStream
strmZipOutputStream =
New ZipOutputStream(File.Create(strZipFileName))
strmZipOutputStream.SetLevel(6)
' #######################
' Compression Level: 0-9
' 0: no(Compression)
' 9: maximum compression
' #######################
Dim strFile As String
For Each strFile In astrFileNames
Dim strmFile As FileStream = File.OpenRead(strFile)
Dim abyBuffer(strmFile.Length - 1) As Byte
strmFile.Read(abyBuffer, 0, abyBuffer.Length)
Dim objZipEntry As ZipEntry = New ZipEntry(strFile)
objZipEntry.DateTime = DateTime.Now
objZipEntry.Size = strmFile.Length
strmFile.Close()
'objCrc32.Reset()
'objCrc32.Update(abyBuffer)
'objZipEntry.Crc = objCrc32.Value
strmZipOutputStream.PutNextEntry(objZipEntry)
strmZipOutputStream.Write(abyBuffer, 0, abyBuffer.Length)
Next
strmZipOutputStream.Finish()
strmZipOutputStream.Close()