Is there any way to read the content of a RAR file (support for multi-file RAR is a must)?
有没有办法读取RAR文件的内容(支持多文件RAR是必须的)?
I don't want to extract the content to the disk, just read it like a stream.
我不想将内容提取到磁盘,只是像流一样读取它。
6 个解决方案
#1
Low level lib to work with 7z.dll (supports rar archives, incliding multi-part, works with .net streams):
低级lib与7z.dll一起使用(支持rar档案,包含多部分,与.net流一起使用):
C# (.net) interface for 7-Zip archive dlls
7-Zip存档dll的C#(。net)接口
And more high-level lib based on the first one:
而更高级的lib基于第一个:
#2
Install NUnrar from nuget
从nuget安装NUnrar
RarArchive file = RarArchive.Open("rar file path");//@"C:\test.rar"
foreach (RarArchiveEntry rarFile in file.Entries)
{
string path = "extracted file path";//@"C:\"
rarFile.WriteToDirectory(path);
}
#4
My unrar project, http://nunrar.codeplex.com/ aims to be very .NETty and has streaming support. If you need something else, please suggest or give me a patch.
我的unrar项目,http://nunrar.codeplex.com/旨在成为非常.NETty并拥有流媒体支持。如果您还需要其他东西,请建议或给我一个补丁。
#5
Another possibility is using including the rar command-line executable as application ressource and call it via System.Diagnostics.Process.
另一种可能性是使用rar命令行可执行文件作为应用程序资源,并通过System.Diagnostics.Process调用它。
You may want to redirect the input/output stream.
您可能希望重定向输入/输出流。
#6
If you want to directly access files stored in uncompressed rar files, then this answer might be of use.
如果要直接访问存储在未压缩的rar文件中的文件,则可能会使用此答案。
ReScene is a project for recreating rar archives from the extracted files. You need a .srr file for this. The source code is available. You may want to take a look at RarStream.cs.
ReScene是一个从提取的文件中重新创建rar存档的项目。你需要一个.srr文件。源代码可用。您可能想看一下RarStream.cs。
#1
Low level lib to work with 7z.dll (supports rar archives, incliding multi-part, works with .net streams):
低级lib与7z.dll一起使用(支持rar档案,包含多部分,与.net流一起使用):
C# (.net) interface for 7-Zip archive dlls
7-Zip存档dll的C#(。net)接口
And more high-level lib based on the first one:
而更高级的lib基于第一个:
#2
Install NUnrar from nuget
从nuget安装NUnrar
RarArchive file = RarArchive.Open("rar file path");//@"C:\test.rar"
foreach (RarArchiveEntry rarFile in file.Entries)
{
string path = "extracted file path";//@"C:\"
rarFile.WriteToDirectory(path);
}
#3
#4
My unrar project, http://nunrar.codeplex.com/ aims to be very .NETty and has streaming support. If you need something else, please suggest or give me a patch.
我的unrar项目,http://nunrar.codeplex.com/旨在成为非常.NETty并拥有流媒体支持。如果您还需要其他东西,请建议或给我一个补丁。
#5
Another possibility is using including the rar command-line executable as application ressource and call it via System.Diagnostics.Process.
另一种可能性是使用rar命令行可执行文件作为应用程序资源,并通过System.Diagnostics.Process调用它。
You may want to redirect the input/output stream.
您可能希望重定向输入/输出流。
#6
If you want to directly access files stored in uncompressed rar files, then this answer might be of use.
如果要直接访问存储在未压缩的rar文件中的文件,则可能会使用此答案。
ReScene is a project for recreating rar archives from the extracted files. You need a .srr file for this. The source code is available. You may want to take a look at RarStream.cs.
ReScene是一个从提取的文件中重新创建rar存档的项目。你需要一个.srr文件。源代码可用。您可能想看一下RarStream.cs。