strOutputFileName=@"C:\1.txt";string filename = strOutputFileName.Substring(strOutputFileName.LastIndexOf('\\'), strOutputFileName.Length - strOutputFileName.LastIndexOf('\\'));Response.Clear();Response.ContentType = "application/x-zip-compressed";Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8));Response.TransmitFile(strOutputFileName);ApplicationInstance.CompleteRequest(); 但下载文件后,发现连网页上的HTML都在文件里面了,文件原来的内容后面加上当前网页的HMTL,请问怎么实现TXT下载呢?
- 2 回答
- 0 关注
- 254 浏览
添加回答
举报
0/150
提交
取消