代码片断,仅供参考。
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition","attachment; filename=" + strFileName);
Response.WriteFile(strFileName);
Response.Flush();
Response.Close();