C# 图片文件文本string格式 传输问题

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;

posted @ 2016-05-04 10:26  天王星天  阅读(314)  评论(0)    收藏  举报