請教...
這是 c#用 Dotnatzip 來壓縮,但我要把它下面的子目錄也全部壓縮進來,應該是要用 zip.AddDirectory(),腦袋想破頭不知要如何寫?
請高手指點一下...
tks.
private static void Compress_Dotnatzip(string target_pathname, string source_pathname)
{
string zipPath = string.Format("{0}{1}.zip", target_pathname,DateTime.Now.ToString("yyyyMMddHHmmss"));
ZipFile zip = new ZipFile();
ArrayList files = GetFiles(source_pathname);
foreach (string f in files)
{
zip.AddFile(f, string.Empty);//第二個參數設為空值表示壓縮檔案時不將檔案路徑加入
}
zip.Save(zipPath);
}
X




























































































