method as shown below: Base64Encode
public static string Base64Encode(string plainText) { byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return System.Convert.ToBase64String(plainTextBytes); }
Method: Base64Decode
The above is the detailed content of How to Encode and Decode Base64 Strings in C#?. For more information, please follow other related articles on the PHP Chinese website!