gpt4 book ai didi

vb.net - SevenZipSharp 在解压时显示当前解压文件

转载 作者:行者123 更新时间:2023-12-02 06:46:00 26 4
gpt4 key购买 nike

我正在使用 vb.net,想知道在提取存档时如何显示正在提取的文件。我已经有了一个解决方法,但它很“作弊”,并且没有真正显示当前正在提取的文件。

Public Class Form1
Private listItemIndex As Integer = 0

Public Sub ext_Extracting(ByVal sender As Object, ByVal e As SevenZip.ProgressEventArgs)
Dim ext As SevenZipExtractor = New SevenZipExtractor("C:\Test.7z")
If listItemIndex < ext.ArchiveFileNames.Count Then
Label1.Text = ext.ArchiveFileNames.Item(listItemIndex).ToString()
listItemIndex += 1
End If
End Sub
End Class

最佳答案

这个答案是OP写的,但不正确edited into the question :

Ok I got it. I had to add "FileInfo.FileName" into "SevenZip.FileInfoEventArgs" then make a reference to it when extracting.

Public Sub FileExtractionStarted(ByVal sender As Object, ByVal e As SevenZip.FileInfoEventArgs)
Label1.Text = e.FileInfo.FileName
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SevenZipExtractor.SetLibraryPath("C:\7z.dll")
Dim ext As SevenZipExtractor = New SevenZipExtractor("C:\test.7z")
ext.BeginExtractArchive("C:\Test")
AddHandler ext.ExtractionFinished, AddressOf ext_ExtractionFinished
AddHandler ext.Extracting, AddressOf ext_Extracting
AddHandler ext.FileExtractionStarted, AddressOf FileExtractionStarted '<---
End Sub

关于vb.net - SevenZipSharp 在解压时显示当前解压文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13784833/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com