public static string DocumentToBase64Str(string fileName) { FileStream filestream = new FileStream(fileName, FileMode.Open); byte[] bt = new byte[filestream.Length]; //调用read读取方法 filestream.Read(bt, 0, bt.Length); string base64Str = Convert.ToBase64String(bt); filestream.Close(); return base64Str; }
标签:base64Str,string,C#,Base64,bt,filestream,文档,FileStream From: https://www.cnblogs.com/ywtssydm/p/17274018.html