在rar里面没有extractinh的GETDIRECTORIES [英] GETDIRECTORIES inside rar without extractinh
本文介绍了在rar里面没有extractinh的GETDIRECTORIES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi everyone I have a lot of rar file.And also there are a lot of folders into this rar files.and I want to GETDIRECTORIES inside rar file and get name of all folder and again enter into folder but without extracting
我尝试过:
------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------
What I have tried:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
推荐答案
你看过 API示例·adamhathcock / sharpcompress Wiki·GitHub [ ^ ]
样品......
have you looked at API Examples · adamhathcock/sharpcompress Wiki · GitHub[^]
A Sample ...
using (Stream stream = File.OpenRead(@"C:\Code\sharpcompress.rar"))
{
var reader = ReaderFactory.Open(stream);
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
Console.WriteLine(reader.Entry.Key);
reader.WriteEntryToDirectory(@"C:\temp", ExtractOptions.ExtractFullPath | ExtractOptions.Overwrite);
}
}
}
它证明可以识别rar文件中的目录 - 无疑还有其他API可以提供帮助
it proves that identifying directories in rar files is possible - doubtless there are other API's out there that may be able to help
这篇关于在rar里面没有extractinh的GETDIRECTORIES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文