编码: byte[] bytes=Encoding.Default.GetBytes("要转换的字符串"); Convert.ToBase64String(bytes); 解码: //"ztKwrsTj"是“我爱你”的base64编码 byte[] outputb = Convert.FromBase64String("ztKwrsTj"); string orgStr= Encoding.Default.GetString(outputb);
原文地址:http://my.oschina.net/u/582827/blog/324404