Home › Forums › .NET libraries › Xceed Zip & Real-Time Zip for .NET › VB.NET code needed
I’ve been looking over the documentation and examples for a couple of hours now, and I guess I am a dumba**, because I can’t figure out how to do a simple task.
I need to zip up a single large file using a method that reports progress (in percentage) using an event. I know this can probably be done in just a few lines, but I’m stumped.
Anyone have a VB.NET example handy?
Imported from legacy forums. Posted by Ted (had 2256 views)
Here is some VB.NET sample code:
<code>Private Shared Sub SimpleZipWithEventForum12502() Dim zipFile As AbstractFile = New DiskFile(“D:\archive.zip”) Dim archive As New ZipArchive(zipFile)
Dim events As New ZipEvents() AddHandler events.ByteProgression, AddressOf events_ByteProgression2
Dim textFile As AbstractFile = New DiskFile(“D:\Test.txt”)
textFile.CopyTo(events, Nothing, archive, True) End Sub
Private Shared Sub events_ByteProgression2(ByVal sender As Object, ByVal e As ByteProgressionEventArgs) Console.WriteLine(“Progression: ” + e.AllFilesBytes.Percent.ToString() + “%”) End Sub </code>
Imported from legacy forums. Posted by CharlesB (had 3423 views)