Encoding and Decoding in C# Ask Question
By       28-Aug-2024    1

How to encode and decode string in C# ,mvc.net 

Solutions


Nawab

There are lot of techniques to handle this but here im going to use Base64 simple one. To convert string into Encoded string use below public static string EncodeBase64(string yourString) { var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return System.Convert.ToBase64String(plainTextBytes); } To convert Encoded string into Base64Decode(string) use below. public static string DecodeBase64(string encodedDatabase64) { var base64EncodedBytes = System.Convert.FromBase64String(encodedDatabase64); return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); }

20
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM