2013-02-23 77 views
0

我會將文件從一個ZipFile複製到另一個ZipFile。將文件從一個zip複製到其他zip - ICSharpCode.SharpZipLib.Zip

爲什麼它很容易?

' Copy files from b.zip to a.zip 
Dim a As New ZipFile(CurDir() & "\a.zip") 
Dim b As New ZipFile(CurDir() & "\b.zip") 

a.BeginUpdate() 

For Each c As ZipEntry In b 
    a.Add(c) 'Error: ICSharpCode.SharpZipLib.Zip.ZipException - Entry cannot have any data 
Next 

a.CommitUpdate() 
a.Close() 

我在.NET 4.5 Visual Basic中使用https://github.com/icsharpcode/SharpZipLib庫。

任何人都可以給我一個小費?

回答

0

如果你的目標壓縮文件與源然後複製整個壓縮文件並重新命名它,爲什麼你做一個接一個文件.........從a.zip

+0

內容: 1。 TXT從b.zip 內容: 2.txt 3.txt 我會測試該系統,我會知道我如何從一個zip壓縮包OPY單個文件到另一個包裏面。 – Patrick 2013-02-23 10:26:13

+0

您需要使用SharpZipLib或DotNetZip等庫。無需解壓縮文件。 – andy 2013-02-23 10:42:06

+0

有沒有一個例子ShareZipLib或DotNetZip如​​何將文件從一個zip文件複製到其他zip文件而不解壓縮?我使用ShareZipLib ^^ – Patrick 2013-02-23 11:00:19

相關問題