C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C# Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

Create or Update a Zip with Multiple Files

Download: Chilkat .NET Assemblies

This C# sample code shows how to create or update a Zip compression archive with specific files that have been selected for updating.

		// Open (or create) a Zip, add files, and save it.
		private void ZipMultiple_Click(object sender, System.EventArgs e)
		{
			Chilkat.Zip zip = new Chilkat.Zip();

			zip.UnlockComponent("30-day trial");

			if (!zip.OpenZip("MyArchive.zip"))
			{
				zip.NewZip("MyArchive.zip");
			}
			// Add individual files.
			// You will need to modify the AppendFromDir and filenames
			// before running this sample code.
			zip.AppendFromDir = "c:\\sampleData";
			
			// Even though the Windows filesystem is not case sensitive,
			// the Zip entry names (filenames) are case-sensitive.
			Chilkat.ZipEntry entry = zip.GetEntryByName("dudeZip.BMP");
			if (entry != null)
			{
				zip.DeleteEntry(entry);
			}
			zip.AppendFiles("dudeZip.BMP",false);

			entry = zip.GetEntryByName("dudeZip2.BMP");
			if (entry != null)
			{
				zip.DeleteEntry(entry);
			}
			zip.AppendFiles("dudeZip2.BMP",false);

			entry = zip.GetEntryByName("dudeZip3.BMP");
			if (entry != null)
			{
				zip.DeleteEntry(entry);
			}
			zip.AppendFiles("dudeZip3.BMP",false);

			// ... append any number of files...

			// Now save the Zip and close it.
			bool success = zip.WriteZipAndClose();
			if (!success)
			{
				MessageBox.Show(zip.LastErrorText);
			}
			else
			{
				MessageBox.Show("Updated Zip Archive");
			}
		}


 

 

 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser