我已經搜索了各地的示例,但似乎無法找到涉及解壓縮某個文件夾的DotNetZip場景。我試圖從.zip文件中提取名爲「CSS」的文件夾,它是.zip文件中的頂級文件夾。這是我的代碼至今: using (ZipFile zip1 = ZipFile.Read(savedFileName))
{
var selection = from e in zip1.Entries
using (ZipFile zip = new ZipFile())
{
foreach(string file in Directory.GetFiles(folder))
{
zip.AddFile(file, Path.GetFileName(file));
}
zip.Save("test.zip"));
}
每次我添加文件時,
public void ZipExtract(string zipfilename, string outputDirectory)
{
using (ZipFile zip = ZipFile.Read(zipfilename))//file not found exception
{
Directory.CreateDirectory(outputDirec