个人抽屉

博客园 首页 新随笔 联系 订阅 管理
'strExcelPath + "\" + strFileName为服务器的文件路径

If File.Exists(strExcelPath + "\" + strFileName) Then

                Response.Clear()
                Response.Charset = "GB2312"
                Response.ContentEncoding = System.Text.Encoding.UTF8
                Response.AddHeader("Content-Disposition", "attachment;filename=MyOwnedIssues.xls")
                'Response.AddHeader("Content-Length", file.Length.ToString());
                Response.ContentType = "application/ms-excel"
                Response.WriteFile(strExcelPath + "\" + strFileName)
                Response.End()
 End If
posted on 2010-08-24 11:12  个人抽屉  阅读(153)  评论(0编辑  收藏  举报