标签:context pos txt 内容 tput ascii url position res
context.Response.ContentType = "text/plain";
string encodeFileName = HttpUtility.UrlEncode("aa.txt");//国际通用防止产生乱码。生成ASCII
context.Response.AddHeader("Content-Disposition", string.Format("attachment;filename=\"{0}\"", encodeFileName));//在响应头中加上Content-Disposition,attachment表示以附件形式下载.
context.Response.WriteFile("aa.txt");//输出文件内容
标签:context pos txt 内容 tput ascii url position res
原文地址:http://www.cnblogs.com/pangzhixing/p/6261568.html