复制代码 代码如下:
if (context.request.useragent.tolower().indexof(msie, system.stringcomparison.ordinal) > -1)//ie浏览器
 {
     context.response.addheader(content-disposition, filename= + httputility.urlencode(filename));
 }
 if (context.request.useragent.tolower().indexof(firefox, system.stringcomparison.ordinal) > -1)//firefox浏览器
 {
     context.response.addheader(content-disposition, attachment;filename=\ + filename + \);
 }
 else//其他浏览器
 {
     context.response.addheader(content-disposition, attachment;filename= + filename);
 }
 context.response.contenttype = application/x-xls;
   
 
   