C#中将字符串转成 Base64 编码
作者:孟宪会 发布日期:2007-01-16 11:41:09
string a = "【孟宪会之精彩世界】"; byte[] b = System.Text.Encoding.Default.GetBytes(a); //转成 Base64 形式的 System.String a = Convert.ToBase64String(b); Response.Write(a); //转回到原来的 System.String。 byte[] c = Convert.FromBase64String(a); a = System.Text.Encoding.Default.GetString(c); Response.Write(a);
原文地址:http://dotnet.aspx.cc/article/4439a5ef-e2c8-4879-a714-ff8dd0099284/print.aspx
© 版权所有 【孟宪会之精彩世界】TM 2012