CSharp examples for System:String Base64
Base64-encodes a string
using System.Text.RegularExpressions; using System.Text; using System.Linq; using System.Globalization; using System;/*ww w . j a v a2 s.c o m*/ public class Main{ #endregion #region Methods: Encoding /// <summary> /// Base64-encodes a string /// </summary> public static string EncodeBase64(this string value) { var bytes = Encoding.ASCII.GetBytes(value); return Convert.ToBase64String(bytes); } }