C# 文件转Base64

  using (FileStream filestream = new FileStream("LOGO.png", FileMode.Open))
            {
                byte[] bt = new byte[filestream.Length];

                //调用read读取方法
                filestream.Read(bt, 0, bt.Length);
               var  base64Str = Convert.ToBase64String(bt);

              return base64Str;
            }


posted @ 2020-02-14 14:37  Alex_Mercer  阅读(3565)  评论(0编辑  收藏  举报