1
Ionic Zip을 사용하여 백업 폴더를 제외하고 특정 폴더의 모든 폴더를 압축합니다 (백업 생성).Ionic.Zip ArgumentException (동일한 키가있는 항목이 이미 추가되었습니다.)
이 내 코드입니다 :
An item with the same key has already been added.
어떻게 가능 :
ZipFile zip = new ZipFile();
string mainpath = HttpContext.Current.Server.MapPath("~/");
Directory.GetDirectories(mainpath).Where(d=> !d.ToLower().EndsWith("backup")).ToList()
.ForEach(d=> zip.AddDirectory(d));
하지만 일부 디렉토리를 추가 한 후
, 나는 다음과 같은 오류를 받고 있어요? 같은 상위 폴더에있는 폴더 목록에 이름이 중복 될 수 있습니까?