标签:文件流 stream byte new return ase public oba 读取
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;
}
标签:文件流 stream byte new return ase public oba 读取
原文地址:https://www.cnblogs.com/MasterLin/p/9842635.html