private void FileDownLoad(string filename, byte[] filebtye)
        {
            Response.Buffer = true;
            Page.Response.Clear();//清除缓冲区所有内容
            Page.Response.ContentType = "application/octet-stream";
            string filenames = filename.Substring(filename.LastIndexOf("\\") + 1);
            Page.Response.AddHeader("Content-Disposition", "attachment;filename=" +
                HttpUtility.UrlEncode(filenames));
            Response.WriteFile(filename);
            //Response.BinaryWrite(filebtye);
            Response.Flush();
            Response.End();
        }

posted on 2012-04-11 11:06  Nature.j  阅读(131)  评论(0编辑  收藏  举报