The ToBase64String method ToBase64String as follows. ( from the wiki )
Base64 is a group of similar coding schemes that represent binary data in ASCII string format, translating it into a radix-64 representation. The term Base64 comes from a specific encoding of the transmission of MIME content.
To use string as byte[] or otherwise, you can use Encoding
Encoding.UTF8.GetString(bytes);
So,
72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100
equally
Hello World
To and from bytes:
var bytes = Encoding.UTF8.GetBytes("Hello world"); var str = Encoding.UTF8.GetString(bytes);
source share