我使用Response.BinaryWrite()编写一个.txt文件进行下载,显示“无法显示XML页面"; [英] i use Response.BinaryWrite() to write a .txt file for download , show "The XML page cannot be displayed "

查看:92
本文介绍了我使用Response.BinaryWrite()编写一个.txt文件进行下载,显示“无法显示XML页面";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆