[C#] 文件转化为二进制流 →→→→→进入此内容的聊天室

来自 , 2019-12-16, 写在 C#, 查看 162 次.
URL http://www.code666.cn/view/dd17e652
  1. //文件绝对路径 File
  2.     private byte[] FileToSteam(string File)
  3.     {
  4.  
  5.         FileStream fs = new FileStream(File, FileMode.Open);
  6.         int streamLength = (int)fs.Length;
  7.         byte[] BTFile = new byte[streamLength];
  8.         fs.Read(BTFile, 0, streamLength);
  9.         fs.Close();
  10.         return BTFile;
  11.     }

回复 "文件转化为二进制流"

这儿你可以回复上面这条便签

captcha