The function of encoding and decoding that has been integrated with the vs2013,c# has been implemented with the invocation of the conversion function Base64.
The main implementation code is as follows:
Using System;
Using System.Collections.Generic;
Using System.ComponentModel;
Using System.Data;
Using System.Drawing;
Using System.Linq;
Using System.Text;
Using System.Windows.Forms;
Namespace Base64_v1
{public
partial class Base64:form
{public
Base64 ()
{ InitializeComponent ();
}
private void Btn_base64_encode_click (object sender, EventArgs e)
{
byte[] InArray = System.Text.Encoding.UTF8.GetBytes (TXT_BASE64_SRC. Text);
Txt_base64_dst. Text = convert.tobase64string (InArray);
}
private void Btn_base64_decode_click (object sender, EventArgs e)
{
byte[] InArray = convert.frombase64string (TXT_BASE64_SRC. Text);
Txt_base64_dst. Text = System.Text.Encoding.UTF8.GetString (InArray);}}}
Run effect