(c#)发送文件下载

 

 1        Response.ClearContent();
 2        Response.ClearHeaders();
 3        Response.ContentType = contentType;
 4        //Response.ContentEncoding = System.Text.Encoding.UTF8;
 5        //Response.Charset = "utf-8";
 6        Response.AddHeader("Content-Disposition:""attachment; filename=" + Server.UrlEncode(fileName));
 7        
 8        Response.WriteFile(DiskFileName);    
 9        Response.Flush();
10        Response.Close();
11        
12        System.IO.File.Delete(DiskFileName);

posted on 2006-09-25 11:26  林晓可  阅读(966)  评论(2编辑  收藏  举报

导航