1

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

c:\Backup\FULLBackup.bak -> c:\Archive\20130322.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:\Archive\20130322.7z","c:\Backup\FULLBackup.bak")

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

4

1 回答 1

0

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

于 2013-05-27T16:37:21.563 回答