文件流转base64字符串

时间:2018-10-24 12:56:28   收藏:0   阅读:331

public static string GetBase64Data()
{
string path = @"C: \txt.jpg";
FileStream filestream = new FileStream(path, FileMode.Open);
byte[] bt = new byte[filestream.Length];
//调用read读取方法
filestream.Read(bt, 0, bt.Length);
string base64Str = Convert.ToBase64String(bt);
filestream.Close();
return base64Str;
}

原文:https://www.cnblogs.com/MasterLin/p/9842635.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!