DotNetZip Место сохранения

Мойн!

 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");
 }

В этом примере MyZipFile.zip хранится в папке «C: \ Program Files (x86) \ IIS Express», я не могу найти простых примеров в сети. Есть ли способ изменить этот путь? Я сомневаюсь, что у меня есть разрешение на посещение моего веб-хостинга.


person BjarkeCK    schedule 18.06.2012    source источник
comment
Что именно вы спрашиваете? Просто укажите полный путь к файлу.   -  person Security Hound    schedule 18.06.2012


Ответы (1)


Измените путь в вашем методе сохранения или во время объявления.

ZipFile zip = new ZipFile("C:\\MyFile.Zip");

or

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");
 }

для получения дополнительной помощи DotNetZip

person Saroop Trivedi    schedule 18.06.2012