CSharp · Console
// C# Extension Method
// Doc: https://csharp-extension.com/en/method/1002190/bytearray-tobase64string
// @nuget: Z.ExtensionMethods
using System;
public class Program
{
public static void Main()
{
byte[] bytes = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
Console.WriteLine("The byte array: ");
Console.WriteLine(" {0}\n", BitConverter.ToString(bytes));
// C# Extension Method: ByteArray - ToBase64String
String s = bytes.ToBase64String();
Console.WriteLine("The base 64 string:\n {0}\n", s);
}
}