VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

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

More Examples...
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

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 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

Dim crypt As New Chilkat.Crypt2()

'  Any string argument automatically begins the 30-day trial.
Dim success As Boolean
success = crypt.UnlockComponent("30-day trial")
If (success <> true) Then
    MsgBox("Crypt component unlock failed")
    Exit Sub
End If


Dim hexStr As String
hexStr = "41424344E0E1E2E3"

Dim fromEncoding As String
fromEncoding = "hex"
Dim toEncoding As String
toEncoding = "base64"

'  Convert from hex to base64
Dim base64 As String
base64 = crypt.ReEncode(hexStr,fromEncoding,toEncoding)
TextBox1.Text = TextBox1.Text & base64 & vbCrLf

'  Now convert from base64 to quoted-printable:
fromEncoding = "base64"
toEncoding = "quoted-printable"
Dim qp As String
qp = crypt.ReEncode(base64,fromEncoding,toEncoding)
TextBox1.Text = TextBox1.Text & qp & vbCrLf

'  Now convert from quoted-printable to URL:
fromEncoding = "quoted-printable"
toEncoding = "url"
Dim urlEnc As String
urlEnc = crypt.ReEncode(qp,fromEncoding,toEncoding)
TextBox1.Text = TextBox1.Text & urlEnc & vbCrLf

'  Now convert from URL back to hex:
fromEncoding = "url"
toEncoding = "hex"
hexStr = crypt.ReEncode(urlEnc,fromEncoding,toEncoding)
TextBox1.Text = TextBox1.Text & hexStr & vbCrLf


'  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-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser