图片转换二进制的实用
引用: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);
string str = Convert.ToBase64String(bytes);
解码:
byte[] outputb = Convert.FromBase64String(str);
string orgStr = Encoding.Default.GetString(outputb);
string orgStr = Encoding.Default.GetString(outputb);