如何使用应用程序资源中的ZIP文件. [英] How to use a ZIP file from Application resource.
本文介绍了如何使用应用程序资源中的ZIP文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我在.NET Framework 4.5中使用了以下代码
Hello i was using the following codes in .NET framework 4.5
using System;
using System.Windows.Forms;
using System.IO.Compression;
using System.Reflection;
namespace prj_Installer.Forms
{
public partial class Installing
{
void Install()
{
ZipFile.ExtractToDirectory(Resource.FilePath, Program.FilePath);
}
}
}
如何获取我的zip文件目录而不从另一个目录中提取或使用它?
从现在开始谢谢.
how i can get my zip File directory without extracting nor using it from another directory?
Thanks from now.
推荐答案
从.NET 4.5开始,您可以使用 https://msdn.microsoft.com/en-us/library/system. io.compression.ziparchiveentry.aspx
Starting with .NET 4.5 you have the ZipArchive Class. Using it and it's brothers allows you to practically treat a zip-File like a folder. In particular you can treat each Entry like a file in a folder:
https://msdn.microsoft.com/en-us/library/system.io.compression.ziparchiveentry.aspx
这篇关于如何使用应用程序资源中的ZIP文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文