No compression at all

Aug 18, 2011 at 9:58 AM

I tried to add some code based on different samples and:

+ 7z archive file is created succcessfully
+ files and folders are added successfully
- there is no compression ratio at all on files

Below is the code:

                    Dim sevenZipCompressor As New SevenZip.SevenZipCompressor()
                    sevenZipCompressor.ArchiveFormat = OutArchiveFormat.SevenZip

                    ' password
                    Dim strPassWord As String = VR.SetVar(EncryptionAPI.DecryptToString(TaskProcess.Task.ArchiveCompress.PassWord))
                    If Not strPassWord = String.Empty Then
                        sevenZipCompressor.ZipEncryptionMethod = SevenZip.ZipEncryptionMethod.Aes256
                        sevenZipCompressor.EncryptHeaders = True
                    End If

                    ' set compression level
                    Select Case TaskProcess.Task.ArchiveCompress.CompressionLevel
                        Case TaskArchiveClass.CompressionLevelT.High
                            sevenZipCompressor.CompressionLevel = SevenZip.CompressionLevel.Ultra
                        Case TaskArchiveClass.CompressionLevelT.Low
                            sevenZipCompressor.CompressionLevel = SevenZip.CompressionLevel.Low
                        Case TaskArchiveClass.CompressionLevelT.Normal
                            sevenZipCompressor.CompressionLevel = SevenZip.CompressionLevel.Normal
                        Case TaskArchiveClass.CompressionLevelT.None
                            sevenZipCompressor.CompressionLevel = SevenZip.CompressionLevel.Normal
                    End Select
                    sevenZipCompressor.CompressionMethod = SevenZip.CompressionMethod.Lzma
                    sevenZipCompressor.FastCompression = False

             
        If File.Exists(strArchiveFile) Then
                    compressor.CompressionMode = CompressionMode.Append
                Else
                    compressor.CompressionMode = CompressionMode.Create
                End If

                Dim files As List(Of String) = SearchAPI.FindFiles(ai.FileFilter, VR)
                Dim strSourceFolder As String = VR.SetVar(ai.FileFilter.SourceFolder)
                compressor.CompressFiles(strArchiveFile, files.ToArray)