使用SevenZipSharp.dll压缩文件



我想使用vb.netSevenZipSharp.dll压缩和移动文件

c:BackupFULLBackup.bak -> c:Archive20130322.7z

我添加了一个引用SevenZipSharp.dll

Imports SevenZip   
SevenZip.SevenZipCompressor.SetLibraryPath(System.AppDomain.CurrentDomain.BaseDirectory & "SevenZipSharp.dll")
Dim theCompressor As New SevenZipCompressor()
            With theCompressor
                .ArchiveFormat = OutArchiveFormat.SevenZip
                .CompressionMode = CompressionMode.Create
                .CompressionMethod = CompressionMethod.Default
                .DirectoryStructure = False
                .CompressionLevel = CompressionLevel.Normal
            End With
theCompressor.CompressFilesEncrypted("c:Archive20130322.7z","c:BackupFULLBackup.bak")

我得到错误:Can not load 7-zip library or internal COM error! Message: library is invalid.

我认为这只是一个事实,即LibraryPath不能指向"SevenZipSharp.dll",而是指向"7z.dll"。http://blog.jongallant.com/2011/10/7-zip-dll-file-does-not-exist.html .UaOLk0DxobA

相关内容

  • 没有找到相关文章