代码如下:
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();