我想在我的网页上显示来自 sql db 的图像, 我得到了格式的图像 {字节[6317]} 如何将其转换为Base64string。
最佳答案
试试这个
Byte[] bytes = File.ReadAllBytes("path");
String file = Convert.ToBase64String(bytes);
And correspondingly, read back to file:
Byte[] bytes = Convert.FromBase64String(b64Str);
File.WriteAllBytes(path, bytes);
关于javascript - 如何使用 JavaScript 将 Byte[] 格式的图像转换为 Base64 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26072366/