根据文件url怎么实现将文件读入byte[] buffer中?
知道的大神,赶紧指条明路吧

解决方案 »

  1.   

     byte[] photo_byte = null;
    //strFile 
                using (FileStream fs = new FileStream(strFile, FileMode.Open, FileAccess.Read))
                {
                    using (BinaryReader br = new BinaryReader(fs))
                    {
                        photo_byte = br.ReadBytes((int)fs.Length);
                    }
      

  2.   

    DownloadData("");返回byte[]  没有返回stream的吧。用webclient大一点文件会超时,有没其他的方法?
      

  3.   

      string url = "文件地址";
                 WebClient wb = new System.Net.WebClient();
                 var photo_byte = wb.DownloadData(url);
      

  4.   

    FileStream 读的是本地文件路径。我需要http路径。