Home >Backend Development >C++ >How to Encode and Decode Base64 Strings in C#?
Code and decoding of Base64 string in C#
method as shown below: Base64Encode
<code class="language-csharp">public static string Base64Encode(string plainText) { byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return System.Convert.ToBase64String(plainTextBytes); }</code>Strough decoding
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!