首页 > 代码库 > base64编码和解码

base64编码和解码

string Str = "abc";// 编码string BaseStr = Convert.ToBase64String(Encoding.UTF8.GetBytes(Str));Console.WriteLine(BaseStr);// YWJj// 解码string OldStr = Encoding.GetEncoding("utf-8").GetString(Convert.FromBase64String(BaseStr));Console.WriteLine(OldStr); // abc

 

base64编码和解码