I hava a folder,it contains some txt files and some subfolders,the subfolders also contains some txt files.I compress the folder to 7Z file using Aspose.ZIP, When i open the output 7Z file, the subfolders are empty.
version info:Aspose.ZIP for Net 22.12
the demo:
void Main()
{
string souceFolder = @"C:\demo\";
string outZipFile = @"C:\out.7z";
using (FileStream zipFile = File.Open(outZipFile, FileMode.Create))
{
using (SevenZipArchive archive = new SevenZipArchive())
{
DirectoryInfo corpus = new DirectoryInfo(souceFolder);
archive.CreateEntries(corpus);
archive.Save(zipFile);
}
}
}
the demo folder:
demo.zip (1.4 KB)
the output 7Z file:
out.7z (678 Bytes)