心黑黑:
先把PDF文件读取到Byte[],然后向Response写入,设置好Header中的文件扩展名。只要客户端机器中PDF有已注册的处理程序,并支持在浏览器中打开,就可以了。里边儿的代……
[阅读: 1617] 2005-03-03 09:46:58
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + Convert.ToString(Guid.NewGuid()) + ".torrent");
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Length", bytes.Length.ToString());
Response.BinaryWrite(bytes);
Response.Charset = ViewState["charset"] != null ? Convert.ToString(ViewState["charset"]) : String.Empty;