Sample code for 30+ languages & platforms
VB.NET

Base64 Encode/Decode a String

See more Encryption Examples

_LANGUAGE_ example to base-64 encode and decode a string.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim bd As New Chilkat.BinData

Dim s As String = "A friend called me up the other day and talked about investing in a dot-com that sells lobsters. Internet lobsters. Where will this end? --Donald Trump"

success = bd.AppendString(s,"utf-8")

Dim strBase64 As String = bd.GetEncoded("base64")
Debug.WriteLine(strBase64)

' To decode:
Dim bd2 As New Chilkat.BinData
bd2.AppendEncoded(strBase64,"base64")

Dim decoded As String = bd2.GetString("utf-8")
Debug.WriteLine(decoded)