文件流转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)