我如何使用SevenZipSharp异步解压缩档案列表并正确处理它们?
这是我正在看的:
Public Class SevenZipVB
Private Shared extractors As New List(Of SevenZipVB)
Private WithEvents _extractor As SevenZip.SevenZipExtractor
''' <summary>
''' Extracts list of archives to their current directory always overwriting
''' </summary>
''' <param name="archives">List of full path names to archives</param>
Public Shared Sub BeginExtraction(ByVal archives As List(Of String))
For Each archive In archives
Dim ext = New SevenZipVB(archive)
extractors.Add(ext)
Next
'magically wait for all extraction to finish but allow the calling thread to continue
End Sub
Private Sub New(ByVal archive As String)
_extractor = New SevenZip.SevenZipExtractor(archive)
_extractor.BeginExtractArchive(Path.GetDirectoryName(archive))
End Sub
Private Sub extractfinished() Handles _extractor.ExtractionFinished
_extractor.Dispose()
End Sub
End Class
我想我必须添加某种异步方法,但我不知道它应该是什么样子。什么好主意吗?
不用麻烦了,这个库已经不支持了,只需使用命令行7za或7zr