I .zip
a file using DotNetZip
, but inside contains subfolders of the actual filepath.
Example: Open Zip > (Users) folder > (Admin) folder > (Desktop) folder > file1.csv
May I know where I should change to that the .zip only contains the file itself?
using (ZipFile zip = new ZipFile())
{
zip.Password = "password";
zip.AddFile("C:\\Users\\Admin\\Desktop\\File1.csv");
zip.Save("Encrypted_File1.zip");
}
I am unsure how to change the .AddFile
statement as there is no declaration of file path anywhere else.