I just want to unrar a rar file from a specific location to the root directory of my program so if my program was on the desktop I want it to unrar a file in My documents and extract the files to my desktop.推荐答案如果您只想解压文件,我可以使用 SharpCompressIf you just want to unrar files, I Was able to do that with SharpCompress首先,我创建了一个新的 VB.Net 应用程序,并在使用此代码从 Rar 文件中提取所有文件之前添加了对 SharpCompress.dll 的引用.First I created a new VB.Net App and added a reference to SharpCompress.dll before using this code to extract all the files from a Rar file.'ImportsImports SharpCompress.ArchivesImports SharpCompress.Common'Unrar codeDim archive As IArchive = ArchiveFactory.Open("C:\file.rar")For Each entry In archive.Entries If Not entry.IsDirectory Then Console.WriteLine(entry.Key) entry.WriteToDirectory("C:\unrar", New ExtractionOptions With {.ExtractFullPath = True, .Overwrite = True}) End IfNext更多代码示例 这篇关于解压一个 rar 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-26 21:50