我使用Response.BinaryWrite()编写一个.txt文件进行下载,显示“无法显示XML页面"; [英] i use Response.BinaryWrite() to write a .txt file for download , show "The XML page cannot be displayed "
问题描述
Response.Clear();
Response.ContentType = Dt.Rows [index] ["FileType"].ToString();
Response.BinaryWrite((byte [])Dt.Rows [index] ["FileData"]));
Response.Clear();
Response.ContentType = Dt.Rows[index]["FileType"].ToString();
Response.BinaryWrite((byte[])Dt.Rows[index]["FileData"]);
推荐答案
Response.ContentType = Dt.Rows [index] ["FileType"].ToString();
Response.ContentType = Dt.Rows[index]["FileType"].ToString();
您是否检查过以确保这是正确的?是什么?
可以肯定地尝试使用Response.Flush()和Response.End(),但是我会说您的mime类型是错误的,并且它期望XML作为结果,并试图显示它.
Did you check to make sure this was correct ? What is it ?
Try Response.Flush() and Response.End() just to be sure, but I''d say your mime type is wrong, and it''s expecting XML as a result, and trying to show it.
这篇关于我使用Response.BinaryWrite()编写一个.txt文件进行下载,显示“无法显示XML页面";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!