Encode String to base 64 String - CSharp System

CSharp examples for System:String Base64

Description

Encode String to base 64 String

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   w w  w . j  a va2 s.  c  o m*/

public class Main{

        public static string Encode(string dataString)
        {
            byte[] base64bytes = Encoding.UTF8.GetBytes(dataString);
            return Convert.ToBase64String(base64bytes);
        }
}

Related Tutorials