你的位置:首页 > ASP.net教程

[ASP.net教程]MVC下载远程文件流(WebClient)


public ActionResult DownLoad_File()    {            return File(ScLiu(PathUrl), "application/octet-stream", "sb.pdf");          } public Stream ScLiu(string path)    {      using (System.IO.MemoryStream memStream = new System.IO.MemoryStream())      {        WebClient webClient = new WebClient();        var obj = webClient.OpenRead(path);        return obj;      }    }