Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active February 28, 2022 05:55
Show Gist options
  • Save aspose-com-gists/0e82250e6c3615557aaa48b2fee2486d to your computer and use it in GitHub Desktop.
Save aspose-com-gists/0e82250e6c3615557aaa48b2fee2486d to your computer and use it in GitHub Desktop.
C# Create Zip File and Archives | Aspose.ZIP for .NET

Create Zip Archive using .NET ZIP API

C# code listed below for adding files or folders to ZIP archives. Learn how to compress files or folders by creating ZIP archives programmatically. Developers can easily integrate and modify these as of their application requirement. Few of the main functions of API

  • Create a ZIP Archive
  • Add Multiple Files into ZIP Archive (using FileStream or FileInfo)
  • ZIP Files using Path
  • Add Folders to a ZIP Archive
  • Create a Password Protected ZIP using ZipCrypto
  • C# Create Password Protected ZIP with AES Encryption methods (AES128 , AES192, AES256)
  • Set Parallel Compression Mode and much more

More details to Zip & Unzip Files using .NET ZIP Library at https://products.aspose.com/zip/net/zip-file/

For Archive code integration there are few prerequisite listed in installation section below.

Installation

Install from command line as nuget install Aspose.ZIP or via Package Manager Console of Visual Studio with Install-Package Aspose.ZIP.

Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads.

More About C# Archive API

Home | Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.3ds", dir+"file.3ds");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.aac", dir+"file.aac");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.amf", dir+"file.amf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ase", dir+"file.ase");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.asp", dir+"file.asp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.avi", dir+"file.avi");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.azw", dir+"file.azw");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.azw3", dir+"file.azw3");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.bmp", dir+"file.bmp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.cdr", dir+"file.cdr");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.cgm", dir+"file.cgm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.chm", dir+"file.chm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.cmx", dir+"file.cmx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.cpp", dir+"file.cpp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.cs", dir+"file.cs");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.csproj", dir+"file.csproj");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.csv", dir+"file.csv");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dae", dir+"file.dae");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dcm", dir+"file.dcm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dgn", dir+"file.dgn");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dib", dir+"file.dib");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dicom", dir+"file.dicom");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dif", dir+"file.dif");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.djvu", dir+"file.djvu");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dng", dir+"file.dng");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.doc", dir+"file.doc");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.docm", dir+"file.docm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.docx", dir+"file.docx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dot", dir+"file.dot");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dotm", dir+"file.dotm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dotx", dir+"file.dotx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dwf", dir+"file.dwf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dwg", dir+"file.dwg");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dwt", dir+"file.dwt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.dxf", dir+"file.dxf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.3mf", dir+"file.3mf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.e00", dir+"file.e00");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.emf", dir+"file.emf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.eml", dir+"file.eml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.emlx", dir+"file.emlx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.eps", dir+"file.eps");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.epub", dir+"file.epub");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.exif", dir+"file.exif");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.fb2", dir+"file.fb2");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.fbx", dir+"file.fbx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.filegdb", dir+"file.filegdb");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.geojson", dir+"file.geojson");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.gif", dir+"file.gif");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.glb", dir+"file.glb");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.gltf", dir+"file.gltf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.gml", dir+"file.gml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.gpx", dir+"file.gpx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.htm", dir+"file.htm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.html", dir+"file.html");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ico", dir+"file.ico");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ics", dir+"file.ics");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ifc", dir+"file.ifc");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.j2k", dir+"file.j2k");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.jp2", dir+"file.jp2");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.jpeg", dir+"file.jpeg");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.jrxml", dir+"file.jrxml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.jt", dir+"file.jt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.kfx", dir+"file.kfx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.kml", dir+"file.kml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.kmz", dir+"file.kmz");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.m4v", dir+"file.m4v");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mbox", dir+"file.mbox");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.md", dir+"file.md");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mhtml", dir+"file.mhtml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mobi", dir+"file.mobi");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mov", dir+"file.mov");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mp3", dir+"file.mp3");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mpp", dir+"file.mpp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mpt", dir+"file.mpt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.mpx", dir+"file.mpx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.msg", dir+"file.msg");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.obj", dir+"file.obj");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.odg", dir+"file.odg");
arch.Save(dir+"archived_result.zip");
}
using (FileStream createdZip = File.Open(dataDir + "Compress_File_out.zip", FileMode.Create)){
using (FileStream src1 = File.Open(dataDir + "test.txt", FileMode.Open, FileAccess.Read)){
using (var arch = new Archive(new ArchiveEntrySettings())){
arch.CreateEntry("test.txt", src1);
arch.Save(createdZip);
}
}
}
using (FileStream zipImageFiles = File.Open(dataDir + "Compress-Image-File-out.zip", FileMode.Create)){
using (FileStream zipFilesrc1 = File.Open(dataDir + "test.bmp", FileMode.Open, FileAccess.Read)){
using (var ImageArch = new Archive(new ArchiveEntrySettings())){
ImageArch.CreateEntry("test.bmp", zipFilesrc1);
ImageArch.Save(zipImageFiles);
}
}
}
using (FileStream zipFile = File.Open(dataDir + "CompressWithTraditionalEncryption_out.zip", FileMode.Create))
{
using (FileStream file1 = File.Open(dataDir + "alice29.txt", FileMode.Open, FileAccess.Read))
{
using (FileStream file2 = File.Open(dataDir + "asyoulike.txt", FileMode.Open, FileAccess.Read))
{
using (var archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p@s$"))))
{
archive.CreateEntry("alice29.txt", file1);
archive.CreateEntry("asyoulik3.txt", file2);
archive.Save(zipFile);
}
}
}
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.odp", dir+"file.odp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ods", dir+"file.ods");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.odt", dir+"file.odt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.oft", dir+"file.oft");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.one", dir+"file.one");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.onetoc2", dir+"file.onetoc2");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.osm", dir+"file.osm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ost", dir+"file.ost");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.otg", dir+"file.otg");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.otp", dir+"file.otp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ott", dir+"file.ott");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pcl", dir+"file.pcl");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdf", dir+"file.pdf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdf", dir+"file.pdf");
arch.Save(dir+"pdf-files-archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdfa", dir+"file.pdfa");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdfe", dir+"file.pdfe");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdfua", dir+"file.pdfua");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdfvt", dir+"file.pdfvt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pdfx", dir+"file.pdfx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.plt", dir+"file.plt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ply", dir+"file.ply");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.png", dir+"file.png");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pot", dir+"file.pot");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.potm", dir+"file.potm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.potx", dir+"file.potx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pps", dir+"file.pps");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ppsm", dir+"file.ppsm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ppsx", dir+"file.ppsx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ppt", dir+"file.ppt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pptm", dir+"file.pptm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pptx", dir+"file.pptx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.ps", dir+"file.ps");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.psb", dir+"file.psb");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.psd", dir+"file.psd");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.pst", dir+"file.pst");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.rtf", dir+"file.rtf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.rvm", dir+"file.rvm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.shp", dir+"file.shp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive()){
arch.CreateEntry("filename.dat", dir+"file.dat");
arch.Save(dir+"result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.sln", dir+"file.sln");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.stl", dir+"file.stl");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.svg", dir+"file.svg");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.swf", dir+"file.swf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.tex", dir+"file.tex");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.tiff", dir+"file.tiff");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.tnef", dir+"file.tnef");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.tsv", dir+"file.tsv");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.txt", dir+"file.3ds");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.u3d", dir+"file.u3d");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vb", dir+"file.vb");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vcf", dir+"file.vcf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vdw", dir+"file.vdw");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vdx", dir+"file.vdx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vrml", dir+"file.vrml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vsd", dir+"file.vsd");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vsdm", dir+"file.vsdm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vsdx", dir+"file.vsdx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vss", dir+"file.vss");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vssm", dir+"file.vssm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vssx", dir+"file.vssx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vst", dir+"file.vst");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vstm", dir+"file.vstm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vstx", dir+"file.vstx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vsx", dir+"file.vsx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.vtx", dir+"file.vtx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.wav", dir+"file.wav");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.webp", dir+"file.webp");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.wmf", dir+"file.wmf");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.wmv", dir+"file.wmv");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.x", dir+"file.x");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.x3d", dir+"file.x3d");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xaml", dir+"file.xaml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xer", dir+"file.xer");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xhtml", dir+"file.xhtml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xlm", dir+"file.xlm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xls", dir+"file.xls");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xlsb", dir+"file.xlsb");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xlsm", dir+"file.xlsm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xlsx", dir+"file.xlsx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xlt", dir+"file.xlt");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xltm", dir+"file.xltm");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xltx", dir+"file.xltx");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xml", dir+"file.xml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xoml", dir+"file.xoml");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xps", dir+"file.xps");
arch.Save(dir+"archived_result.zip");
}
var dir = "full directory path";
using (var arch = new Archive())
{
arch.CreateEntry("filename.xslfo", dir+"file.xslfo");
arch.Save(dir+"archived_result.zip");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment