引用:http://www.cnblogs.com/lindana/archive/2009/03/25/1421345.html
js调用: $("#div2").html("<img src=\"data:image/bmp;base64,"+data+"\"/> ");
编码:
byte[] bytes = Encoding.Default.GetBytes("要转换的字符");
string str = Convert.ToBase64String(bytes);
解码:
byte[] outputb = Convert.FromBase64String(str);
string orgStr = Encoding.Default.GetString(outputb);
时间: 2024-11-03 13:08:17