52
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
6
namespace ConsoleApplication1
7
{
8
public class Program
9
{
10
public static void Main()
11
{
12
string sInputString = "Hello World";
13
14
string sBase64Output = Base64Encode(sInputString); //"SGVsbG8gV29ybGQ=" is returned.
15
Console.WriteLine(string.Format("'{0}' into Base64 format: {1}", sInputString,sBase64Output));
16
17
string sStringOutput = Base64Decode(sBase64Output);
18
Console.WriteLine(string.Format("Converted Base64 text '{0}' into string is: {1}", sBase64Output, sStringOutput));
19
20
Console.ReadLine();
21
}
22
23
/// <summary>
24
/// Function to convert or encode any text into Base64 format.
Cached Result