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

 

 

 

 

 

 

In-Memory Zip / Unzip Code

Download Chilkat .NET for 4.0 Framework

Download Chilkat .NET for 64-bit 4.0 Framework (x64)

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

Demonstrates some features of using the Zip component entirely in-memory.

Chilkat.Zip zip = new Chilkat.Zip();

bool success;

//  Any string unlocks the component for the 1st 30-days.
success = zip.UnlockComponent("Anything for 30-day trial");
if (success != true) {
    MessageBox.Show(zip.LastErrorText);
    return;
}

//  NewZip initializes the zip object.  It does not write
//  the file.  The "test.zip" file, in this case, will never be written.
success = zip.NewZip("test.zip");
if (success != true) {
    MessageBox.Show(zip.LastErrorText);
    return;
}

//  Append a string as a file within the zip object.
Chilkat.ZipEntry entry = null;
//  The last argument to AppendString2 is a charset name.
entry = zip.AppendString2("test.txt","This is a test 123 ABC 123 ABC","iso-8859-1");

//  zipImage is a byte array that contains a .zip file.
//  The WriteToMemory method writes the .zip to a byte array
//  instead of writing to a file.
byte[] zipImage = null;
zipImage = zip.WriteToMemory();

//  Now.. let's open the .zip from a byte array.
Chilkat.Zip zip2 = new Chilkat.Zip();

success = zip2.OpenFromMemory(zipImage);
if (success != true) {
    MessageBox.Show(zip2.LastErrorText);
    return;
}

//  Now get the test.txt entry:
entry = zip2.GetEntryByName("test.txt");
if (entry == null ) {
    MessageBox.Show("Failed to find test.txt");
    return;
}

//  Inflate the entry to a byte array:
byte[] entryBytes = null;
entryBytes = entry.Inflate();

//  Inflate the entry to a string:
string entryStr;
entryStr = entry.InflateToString2();

MessageBox.Show(entryStr);


 

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

Email Component · XML Parser