欢迎加入站点基地设计开发交流群:30720409
详细内容
读取文件流流然后成为下载形式
发布日期:2010-01-26     点击:4577     字体:[ ]

代码如下:

      byte[] buffer=(byte[])ds.Tables[0].Rows[0]["Content"];
      //buffer数组为要读取的文件流
       Response.Clear();
       Response.AddHeader("Content-Disposition","attachment; filename="+ds.Tables[0].Rows[0]   ["FName"].ToString());
     //ds.Tables[0].Rows[0]["FName"].ToString()为要下载的文件名
       Response.ContentType="application/x-msdownload";

       Response.BinaryWrite(buffer);
       Response.End();

用户评论
昵称:123 来自:121.229.148.*  
2011/1/25 19:39:07
sdewfew
昵称:匿名 来自:121.229.148.*  
2011/1/25 19:38:07
sdasasfw
昵称 
内容  *
验证码   
   
相关文章 更多...  
Copyright © 2010 zdbase.com All Rights Reserved. 苏ICP备15039389号 可人软件设计