不废话,直接上代码,就是这么简单
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); }