下载文件成流

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;
    }
  }
}

posted @ 2016-12-23 15:26  码来码去  阅读(139)  评论(0编辑  收藏  举报