CSharp examples for System:Converter
Base 64 Encode with Convert class
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;//from www . j ava 2 s . c o m public class Main{ /// <summary> /// base64 ??? /// </summary> /// <param name="str"></param> /// <returns></returns> public static string EnCode(string str) { byte[] bytes = Encoding.Default.GetBytes(str); return Convert.ToBase64String(bytes); } }