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 Self-Extracting EXE in C#

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

This is a simple example demonstrating how to create a self-extracting EXE in C#. It zips a directory tree and creates a .exe that can be run without the .NET runtime or any system DLLs (it is completely standalone).


private void CreateExe_Click(object sender, System.EventArgs e)
{
	// If this does not compile or work correctly,
	// download and install the latest version
	// of Chilkat .NET and try again.  Some of the
	// self-extracting EXE properties, such as AutoTemp
	// were added in a recent version.

	Chilkat.Zip zip = new Chilkat.Zip();
	zip.UnlockComponent("30-day trial");

	// We will never actually write test.zip, because
	// we'll be writing a self-extracting EXE instead.
	zip.NewZip("test.zip");

	zip.AppendFiles("./SendMail",true);

	// Set AutoTemp to true if you wish the EXE to automatically
	// unzip into a auto-selected temp directory when the EXE
	// is run.
	//zip.AutoTemp = true;

	// Set AutoRun to the name of an EXE within the
	// archive to automatically run it after the 
	// self-extracting EXE is unzipped.
	//zip.AutoRun = "setup.exe";
	
	// Set the title bar for the EXE
	zip.ExeTitle = "This is my self-extracting EXE";

	// Write a self-extracing EXE.  The LastError
	// property will contain error information if
	// it fails
	if (!zip.WriteExe("test.exe"))
	{
		textBox1.Text = zip.LastErrorText;
	}
	else
	{
		textBox1.Text = "Self-extracting EXE successfully created!";
	}


	// Make sure all resources are released.
	zip.CloseZip();
}


 

 

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

Email Component · XML Parser