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

 

 

 

 

 

 

Open Zip from Image in Memory

Download: Chilkat .NET Assemblies

Opens a Zip file from memory and unzips the first file. An image of the Zip file is in-memory, and this is opened as if it were a file on disk.

		private void button1_Click(object sender, System.EventArgs e)
		{
			// Make the byte array big enough to hold the file
			int iSize = 500000;

			// loading data to memory - emulating data gathered from network
			System.IO.FileStream fs = new System.IO.FileStream("test.zip", 
				System.IO.FileMode.Open, System.IO.FileAccess.Read);
			byte[] b = new byte[iSize];
			fs.Read(b, 0, iSize);
			fs.Close();

			// Create the Zip object and unlock it.
			Chilkat.Zip zip = new Chilkat.Zip();
			zip.FileName = "anything.zip";
			zip.UnlockComponent("30-day trial");

			// Open the Zip from memory
			bool openSuccess = zip.OpenFromMemory(b);
			if (openSuccess)
			{
				// Display the start time.
				label1.Text = DateTime.Now.ToLongTimeString();
				label1.Refresh();

				// Inflate the 1st file in the Zip.
				byte [] c = zip.FirstEntry().Inflate();

				// Display the end time.
				label2.Text = DateTime.Now.ToLongTimeString();
				label2.Refresh();

				// writing file to disk
				fs = new System.IO.FileStream(zip.FirstEntry().FileName, System.IO.FileMode.OpenOrCreate,
					System.IO.FileAccess.Write);
				fs.Write(c, 0, c.Length);
				fs.Close();
			}
			else
			{
				// Display error message.
				textBox1.Text = zip.LastErrorText;
			}


		
		}


 

 

 

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

Email Component · XML Parser