关于下载txt文本文挡的问题
下载文本文档会直接打开
需要做一些操作来避免,改变页面的头文件
Code
Page.Response.Clear();
Page.Response.AppendHeader("Content-Disposition", "attachment;Filename=" + fileName);
Page.Response.ContentType = "text/plain";
Page.Response.Write(sb.ToString());
Page.Response.End();
fileName为要下载的文本文件名
原文地址:https://www.cnblogs.com/ycsfwhh/p/1402257.html