在c#中提取.rar文件

本文关键字:rar 文件 提取 | 更新日期: 2023-09-27 17:54:49

我正在尝试为我正在制作的小工具制作自动更新功能。我得到的点,当它下载。rar文件,但现在我必须提取这个。rar文件。为此,我使用Ionic.Zip(A reference),如下所示:

ZipFile zipFile = new ZipFile(Path.GetDirectoryName(Application.ExecutablePath) + @"'Tool[" + Program.newVersion + "].rar");
zipFile.ExtractAll(Application.StartupPath);

但是当运行这个时,它给我一个"System.Reflection"。TargetInvocation"例外…有人知道我做错了什么,或者有另一个解决方案来提取。rar文件!

在c#中提取.rar文件

DotNetZip/Ionic不支持。rar文件:

DotNetZip可以读或写RAR文件吗?

。DotNetZip做zip文件。

http://dotnetzip.codeplex.com/

你可以使用SharpCompress之类的东西,它在其他扩展名中支持。rar文件。