I am using VB.Net 2010 and I would like to display the progress while I am extracting a 7zip archive. So far, I have the below code, which will extract the file, but does not show any progress.
Dim zdllov As String = Application.StartupPath() & "\7z.dll"
Dim ext As SevenZipExtractor = New SevenZipExtractor("C:\test-archive.7z")
I see that there are some delegates for file extraction, but I cannot for the life of me figure out how to actually implement them. Can anyone help me, please?
Below is some of the things I have found, for reference.
Public Sub ExtractFileEvents(ByVal sender As Object, ByVal e As SevenZip.ProgressEventArgs) Handles sze.Extracting
If e.Cancel = True Then
MsgBox("Cancel event raised")
e.Cancel = WasCanceled
You absolutely don't have to use any lambda. Consider this alternative C# code:
tmp.FileCompressionStarted += new EventHandler<FileInfoEventArgs>(tmp_FileCompressionStarted);
[method outside yours]
static void tmp_FileCompressionStarted(object sender, FileInfoEventArgs e)
//place event code here