asp.net mvc 下载文件 txt doc xsl 等等

 

  

不废话,直接上代码,就是这么简单
 public FileStreamResult StreamFileFromDisk()
        {

            // string path = AppDomain.CurrentDomain.BaseDirectory + "uploads/";

            string fileName = "中国学前教育研究会用户需求说明书0203-正式版.txt";
            string str = @"E:\需求\电影.txt";
            return File(new FileStream(str, FileMode.Open), "text/plain", fileName);

        }

  


posted @ 2015-03-16 16:15  朝闲  阅读(358)  评论(0编辑  收藏  举报