Append files to zip file with C#

Open an existing zip file and append files with C# and DotNetZip library.

public void AppendFile(String Filename, Zipfilename){	
	if (File.Exists(Zipfilename))
	{
		ZipFile _zipfile = ZipFile.Read(Zipfilename);
		try
		{
			_zipfile.AddFile(Filename);
		}
		catch { }
		_zipfile.Save();
		_zipfile = null;
	}
}
Categories: C# Tags: , , ,
%d bloggers like this: