会员
周边
捐助
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
用怪异的眼光去研究
亮.net
博客园
首页
新随笔
新文章
联系
订阅
管理
关于String 和 Base64 之间的互转 比较简单!
public
static
String EncryptBase64Code(String text)
{
Byte[] bufin
=
System.Text.ASCIIEncoding.UTF8.GetBytes(text);
String result
=
Convert.ToBase64String(bufin,
0
, bufin.Length);
return
result;
}
public
static
String DecryptBase64Code(String text)
{
try
{
Byte[] bufout
=
Convert.FromBase64String(text);
String result
=
System.Text.ASCIIEncoding.UTF8.GetString(bufout);
return
result;
}
catch
{
return
text;
}
}
posted on
2006-10-11 11:02
李佩亮
阅读(
849
) 评论(
0
)
编辑
收藏
举报
刷新页面
返回顶部