ToBase64String() is a method in the C# System library that converts an array of 8-bit unsigned integers and converts them to its string equivalent with Base-64 encoding. To use this tag, the programming language must be C# and it must concern the use of this method.
Syntax
Given a byte array of
byte[] bytArr = new byte[1] { 2 }; // 00000010
ToBase64String() will convert the byte array to a new string with its equivalent value using Base-64 encoding.
string b64Str = Convert.ToBase64String(bytArr);
The variable b64Str will now contain Ag==.
References