FileStream fs = new FileStream("h:/file.jpg", FileMode.Open);
byte[] bytes = new byte[fs.Length];
int i = fs.Read(bytes, 0, bytes.Length);
string str = Convert.ToBase64String(bytes);
====================================================
是这样我就可以把图片转成Base64了吧,有2个问题.
1.我的图片不是地址,是在pictureBox中的image类型的数据
2.我要怎么才能给他再转成image的呢
byte[] bytes = new byte[fs.Length];
int i = fs.Read(bytes, 0, bytes.Length);
string str = Convert.ToBase64String(bytes);
====================================================
是这样我就可以把图片转成Base64了吧,有2个问题.
1.我的图片不是地址,是在pictureBox中的image类型的数据
2.我要怎么才能给他再转成image的呢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货