首页 > 代码库 > 下载文件成流

下载文件成流

public static class StreamHelper
{
  public static Stream DownloadFile(string path)
  {
    using (var client = new WebClient())
    {
      var stream = client.DownloadData(path);
      var outStream = new MemoryStream(stream);
      return outStream;
    }
  }
}

下载文件成流