0

i have a question, i have a directory with all kind of files.

when a user clicks on a button in my wpf application, all the files will be added to a zip file in another directory.

the problem now is it always zips all the data into the zip. What i want is that it only adds new files to the zip file. how do i check if files already excist in the zip file?

what i got so far:

 using (ZipFile zip = new ZipFile())
            {
                zip.Password = "12345";
                zip.Encryption = EncryptionAlgorithm.WinZipAes256;
                zip.AddDirectory(@"C:\upload\");
                zip.Save(@"D:\ftp\Backup.zip");
            }

Thanks gr thomas

Thomas V
  • 151
  • 14

1 Answers1

0

I don't believe you can check the contents of a zip file with the standard .NET libraries. You could use the dotnetzip library to achieve this but it seems to me the easiest thing for you to do would be to move the files out of the folder once they have been zipped that way any files in your directory can be considered "new".

totalfreakingnoob
  • 413
  • 1
  • 9
  • 25