try
{
if(!Page.IsPostBack)
{
string strFileName="";
strFileName=Request.QueryString["FILE_NAME"].ToString();
strFileName=HttpUtility.UrlEncode(System.Text.Encoding.UTF8.GetBytes(strFileName));
Response.Clear();
Response.ContentType="application/x-msexcel";
Response.AddHeader("Content-Disposition", "inline; filename="+strFileName);
System.IO.FileStream MyFileStream=new FileStream(Request.QueryString["REPORT_FILE"].ToStrin(),System.IO.FileMode.Open,System.IO.FileAccess.Read,System.IO.FileShare.Read);
long FileSize=MyFileStream.Length;
byte[] Buffer=new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)FileSize);
MyFileStream.Close();
Response.BinaryWrite(Buffer);
}
}
catch(Exception exp)
{
Response.Write("导出数据错误!");
}