English 中文(简体)
将拉链文件保存到同一个目录
原标题:save the zipped file to the same directory

我有一个问题, 我是新来的C##,

我使用 DotNetZip 库来拉链我的文件夹... 当我试图保存它时... 它试图保存到程序文件/ 二, 并给我一个错误, 说没有权限保存到那个位置... 。 我做什么来保存到同一个目录, 可以帮一个忙 : ()

我在做一些类似

using (ZipFile zip = new ZipFile())
{
    zip.AddDirectory(Mypath);
    zip.Save("zippedfolder.zip");
}

我知道我的问题很简单 直截了当 但我不知道该怎么处理...谁能帮帮我吗?

PS:如果我的问题不清楚,请让我知道,我可以再次解释。

谢谢!

最佳回答

保存到 Mypath/ zipped 折叠器.zip :

zip.Save(Path.Combine(Mypath, "zippedfolder.zip"));
问题回答

我假设这是 ASP 。 您需要在您的网络根中创建一个文件夹, 使用 < code> server. MapPath ("~/ FolderName") 获取物理路径, 并附加您想要使用的名称/ 和路径, 然后保存 。

请注意,您的应用程序正在以特定身份运行( 通常是同时运行您的 IIS 应用程序库的应用程序), 因此账户需要权限才能写入目录 。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签