我正在编写一个用于分发的 vb.net 脚本,但我遇到了问题。该脚本无法使用 COM 引用的 Shell32 库提取 zip 文件而不触发防病毒,因为我正在构建一个 exe。我想知道是否有人知道在 vb.net 中提取文件的更好方法,或者仅仅是防病毒软件不会删除我的脚本的方法,因为这将是一个分布式程序。
禁用防病毒软件不是解决方案,因此不建议这样做。
尝试这个
Private Sub unzip()
Dim sc As New Shell32.Shell()
'Declare the folder where the files will be extracted
Dim output As Shell32.Folder = sc.NameSpace("D:\unzip")
'Declare your input zip file as folder .
Dim input As Shell32.Folder = sc.NameSpace("D:\zipFiles\")
'Extract the files from the zip file using the CopyHere command .
output.CopyHere(input.Items, 4)
End Sub