文件下载

 string Path = Request.PhysicalApplicationPath + "App_Data" + "\\" + "aaa.mdb";
        FileInfo info 
= new FileInfo( Path );
        
if( info.Exists )
        
{
            Response.Clear();
            Response.ClearHeaders();
            Response.Buffer 
= false;
            Response.ContentType 
= "Application/octet-stream";           
            Response.AddHeader( 
"Content-Disposition""attachment;filename=" + HttpUtility.UrlEncode( info.FullName, Encoding.UTF8 ) );
            Response.WriteFile( info.FullName );
            Response.Flush();
            Response.End();
        }
posted @ 2008-07-11 22:45  Magicam  阅读(290)  评论(0编辑  收藏  举报