简体   繁体   English

如何从C#中的7-ZIP存档中提取单个文件?

[英]How to extract a single file from a 7-ZIP archive in C#?

I Have a 7-Zip file that contains many files inside. 我有一个7压缩文件,其中包含许多文件。 How can I extract one special file inside without extracting the whole archive? 如何在不提取整个存档的情况下提取一个特殊文件?

Is it possible to list all the files and choose one to get in C#? 是否可以列出所有文件并选择一个文件以获取C#?

You first off all must use 7-zip stand alone console. 首先,您必须使用7-zip独立控制台。 this post can help you. 这篇文章可以为您提供帮助。

then in console you can filter files by using filters section 然后在控制台中,您可以使用“过滤器”部分过滤文件

7za.exe x archive.zip -o outputdir *.xml *.pdb *.exe *.ocx *.dll -r

or simple 7za.exe x archive.zip -o outputdir a.xml -r 或简单的7za.exe x archive.zip -o outputdir a.xml -r

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM