Answers for "convert file to base64 string c#"

C#
17

convert to base64 c#

public static string Base64Encode(string plainText) {
  var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
  return System.Convert.ToBase64String(plainTextBytes);
}
Posted by: Guest on April-27-2020
0

convert stream to base64 string c#

You can also encode bytes to Base64. How to get this from a stream see here: How to convert an Stream into a byte[] in C#?

Or I think it should be also possible to use the .ToString() method and encode this.
Posted by: Guest on March-12-2021

Code answers related to "convert file to base64 string c#"

C# Answers by Framework

Browse Popular Code Answers by Language