2013-03-22 36 views
1

我要压缩和使用vb.netSevenZipSharp.dll压缩使用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.

回答