Auf Codeplex ist eine neue .NET Library veröffentlicht worden, mit der man ohne 3rd-Party tools zippen kann.
Das ganze ist umsonst und kann bei Codeplex heruntergeladen werden: DotNetZip
33 Console.WriteLine("Extracting file {0} to {1}", ZipToUnpack, TargetDir)
34 Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack)
35 AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress
36 Dim e As ZipEntry
37 ' here, we extract every entry, but we could extract
38 ' based on entry name, size, date, etc.
39 For Each e In zip1
40 e.Extract(TargetDir, _
ExtractExistingFileAction.OverwriteSilently)
41 Next
42 End Using
Und ein Beispiel um dateien zu einem Zip-Archiv hinzuzufügen:
33 Dim zip As ZipFile = New ZipFile()
34 Try
35 ' add this map file into the "images" directory in the zip archive
36 zip.AddFile("c:\images\personal\7440-N49th.png", "images")
37 ' add the report into a different directory in the archive
38 zip.AddFile("c:\Reports\2008-Regional-Sales-Report.pdf", "files")
39 zip.AddFile("ReadMe.txt")
40 zip.Save("MyZipFile.zip")
41 Catch ex As Exception
42
43 End Try
Gefunden bei Norbert Eder