您的位置:程序门 -> .net技术 -> c#



各位大哥,麻烦看看下面这段代码,在ie6下一点问题都没有,但是在ie7下却显示不出效果,经查是response.writefile(filepath)的问题,估计是ie7安全性太高,可是设为最低还不行,大家帮解决下啊.


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


各位大哥,麻烦看看下面这段代码,在ie6下一点问题都没有,但是在ie7下却显示不出效果,经查是response.writefile(filepath)的问题,估计是ie7安全性太高,可是设为最低还不行,大家帮解决下啊.
发表于:2007-10-24 14:40:29 楼主


if(!ispostback)
{
namevaluecollection   namevalue   =   request.querystring;
if   (namevalue==null)   return   ;
string   filepath = namevalue.get("file");
if(filepath==null   ¦ ¦   filepath=="")   return;
filepath   =   request.physicalapplicationpath   +   "rpt\\"+filepath;
if(file.exists(filepath))
{
response.clearheaders();
response.clearcontent();
//response.buffer       =       true;  
if   (filepath.endswith(".doc"))
{
response.contenttype   =   "application/msword";
}
else   if   (filepath.endswith(".xls"))
{
response.contenttype   =   "application/vnd.ms-excel";
}
else   if   (filepath.endswith(".pdf"))
{
response.contenttype   =   "application/pdf";
}
else   if   (filepath.endswith(".rpt"))
{
response.contenttype   =   "application/rpt";
}
else
{
return;
}


response.writefile(filepath);
response.flush();
}
response.end();
response.close();
}
发表于:2007-10-24 14:45:311楼 得分:0
大家帮帮忙啊.
发表于:2007-10-24 14:51:002楼 得分:0
大家帮帮忙啊.
发表于:2007-10-24 15:14:263楼 得分:0
up
发表于:2007-10-25 09:54:364楼 得分:0
怎么没有人关注啊.
发表于:2007-10-25 10:26:195楼 得分:0
告诉你ie7有些东西不能用的,所以你最好说明只能在ie6下使用,但具体哪些特性不能使用我也不清楚,我们的项目ie7下也是不正常的.
发表于:2007-10-25 11:29:486楼 得分:0
我知道有些东东在ie7用不了,但是用不用ie7不是我说了算,而是老板和客户说了算啊!现在客户要用ie7,真是没办法了.再说我们不能硬要求客户用ie6了吧!
发表于:2007-10-25 13:11:557楼 得分:0
帮顶一下,看看别人有没有办法
发表于:2007-10-26 14:39:258楼 得分:0
可能是安全的原因.但是怎么解决呢?ie7这家伙真是把我搞晕了啊.


快速检索

最新资讯
热门点击