C# Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

C# Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
RSA Encryption
S/MIME
Socket
Spider
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
String
Byte Array
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

Re-Encode a String (Hex, Base64, URL, etc)

Demonstrates how to convert from one encoding to another. For example: base64 to hex, URL to base64, base64 to quoted-printable, etc.

Note: The ReEncode method is unreleased at the time of this writing (08-April-2008) The next major Chilkat Crypt2 release after this date will include the ReEncode method.

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

//  Any string argument automatically begins the 30-day trial.
bool success;
success = crypt.UnlockComponent("30-day trial");
if (success != true) {
    MessageBox.Show("Crypt component unlock failed");
    return;
}

string hexStr;
hexStr = "41424344E0E1E2E3";

string fromEncoding;
fromEncoding = "hex";
string toEncoding;
toEncoding = "base64";

//  Convert from hex to base64
string base64;
base64 = crypt.ReEncode(hexStr,fromEncoding,toEncoding);
textBox1.Text += base64 + "\r\n";

//  Now convert from base64 to quoted-printable:
fromEncoding = "base64";
toEncoding = "quoted-printable";
string qp;
qp = crypt.ReEncode(base64,fromEncoding,toEncoding);
textBox1.Text += qp + "\r\n";

//  Now convert from quoted-printable to URL:
fromEncoding = "quoted-printable";
toEncoding = "url";
string urlEnc;
urlEnc = crypt.ReEncode(qp,fromEncoding,toEncoding);
textBox1.Text += urlEnc + "\r\n";

//  Now convert from URL back to hex:
fromEncoding = "url";
toEncoding = "hex";
hexStr = crypt.ReEncode(urlEnc,fromEncoding,toEncoding);
textBox1.Text += hexStr + "\r\n";

//  The output of this program is:
//  QUJDRODh4uM=
//  ABCD=E0=E1=E2=E3
//  ABCD%E0%E1%E2%E3
//  41424344E0E1E2E3

 

Need a specific example? Send a request to support@chilkatsoft.com

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

Email Component · XML Parser