以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]怎样用代码吧文件转换为base64? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=164233) |
-- 作者:zto001 -- 发布时间:2021/4/30 14:12:00 -- [求助]怎样用代码吧文件转换为base64? [求助]怎样用代码吧文件转换为base64? |
-- 作者:有点蓝 -- 发布时间:2021/4/30 14:40:00 -- Dim data() As Byte = System.IO.File.ReadAllBytes("c:\\abc.jpg") \'把图像文件字节流加载进来, dim s as string = Convert.ToBase64String(data)
|
-- 作者:zto001 -- 发布时间:2021/5/1 0:39:00 -- 那能不能把 base64 转换成图片? |
-- 作者:有点蓝 -- 发布时间:2021/5/5 8:47:00 -- Dim bs As Byte() = Convert.FromBase64String(base64字符串) Dim stream As System.IO.Stream = New System.IO.MemoryStream(bs) Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(stream) Dim pbx As WinForm.PictureBox = Forms("窗口1").Controls("PictureBox1 pbx.Image = bmp
|