2.4. Base64 Encode Binary Data
You need to convert binary data into a form that can be stored as part of an ASCII text file (such as an XML file) or sent as part of a text e-mail message.
Use the Shared methods ToBase64CharArray and FromBase64CharArray of the System.Convert class to convert your binary data to and from a Base64-encoded Char array. If you need to work with the encoded data as a string value rather than as a Char array, you can use the ToBase64String and FromBase64String methods of the Convert class instead.
How It Works
Base64 is an encoding scheme that enables you to represent binary data as a series of ASCII characters so that it can be included in text files and e-mail messages in which raw binary data is ...