您可以使用Content-Disposition头和Response.AddHeader方法来设置下载文件的名称。context.Response.AddHeader("Content-Disposition", "attachment; filename=myFileName.txt");