会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
且行且歌
http://www.cnblogs.com
StringToBase64
string To Base64
using
System;
using
System.Text;
public
class
Base64
{
public
static
void
Main()
{
string
a
=
"
【孟宪会之精彩世界】
"
;
//
转成 Base64 形式的 System.String
byte
[] b
=
Encoding.Default.GetBytes(a);
a
=
Convert.ToBase64String(b);
Console.WriteLine(a);
Console.WriteLine(
"
---------
"
);
//
转回到原来的 System.String。
byte
[] c
=
Convert.FromBase64String(a);
a
=
Encoding.Default.GetString(c);
Console.WriteLine(a);
Console.WriteLine(
"
----------
"
);
Console.Read();
}
}
posted on
2007-07-18 08:17
simhare
阅读(
5249
) 评论(
0
)
编辑
收藏
举报
刷新页面
返回顶部
导航
博客园
首页
新随笔
联系
订阅
管理
公告