C# DotNetZip保存位置
莫恩C# DotNetZip保存位置,c#,zip,dotnetzip,C#,Zip,Dotnetzip,莫恩 此示例将MyZipFile.zip存储在“C:\Program Files(x86)\IIS Express”中,我在网络上找不到任何简单的示例有任何方法更改该路径吗?我怀疑我是否有权限在我的网络主机上访问该网站。更改保存方法中的路径或在声明时更改路径 using (ZipFile zip = new ZipFile()) { // add this map file into the "images" directory in the zip archive zi
此示例将MyZipFile.zip存储在“C:\Program Files(x86)\IIS Express”中,我在网络上找不到任何简单的示例有任何方法更改该路径吗?我怀疑我是否有权限在我的网络主机上访问该网站。更改保存方法中的路径或在声明时更改路径
using (ZipFile zip = new ZipFile())
{
// add this map file into the "images" directory in the zip archive
zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
// add the report into a different directory in the archive
zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
zip.AddFile("ReadMe.txt");
zip.Save("MyZipFile.zip");
}
或
要获得更多帮助你到底在问什么?只需提供文件的完整路径。
ZipFile zip = new ZipFile("C:\\MyFile.Zip");
using (ZipFile zip = new ZipFile())
{
// add this map file into the "images" directory in the zip archive
zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
// add the report into a different directory in the archive
zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
zip.AddFile("ReadMe.txt");
zip.Save("C:\\MyZipFile.zip");
}