string file = @"E:\test.png";
byte[] bytes = File.ReadAllBytes(file);
// 主要代码
string datas = Convert.ToBase64String(bytes);
byte[] filebytestt = Convert.FromBase64String(datas);
//
string imagename = @"E:\testTmp.png";
var imgFile = File.Create(imagename, filebytestt.Length);
imgFile.Write(filebytestt, 0, filebytestt.Length);
imgFile.Close();
imgFile = null;
C# 图片文件文本string格式 传输问题
推荐阅读
- 【Vue】更改安装时的包管理器为yarn或npm
- 【win10】好用的终端 cmder
- webpack打包报错 Cannot find module 'webpack-cli/bin/config-yargs'
- 【VSCode】打开文件 总是会覆盖 上次已经打开的解决方法
- 【Vue】报错'scope' is defined but never used解决方法总结
- width=100%和width=auto的区别
- js 前置递增(++...) 和 后置递增 (...++) 的差异原理
- shiro 配置注解异常 java.lang.ClassNotFoundException: org.aspectj.util.PartialOrder$PartialComparable
- chrome 截取整个网页
- java equals 和 == 区别