大家好,
作为解决我以前的帖子"
我发现这个代码,我想,但我想要的是打开了新的一页,打开pdf文件?
我的代码是
string fileToRenamePath = RMAConfig.PDFPath + "Return Documentation [ " + this.rmaObjSum.RMANum + " ]" + RMAConfig.Extension;
// The valeu for fileToRenamePath here is : C:/RMA/Returns/Return Documentation[3232-32326].pdf
WebClient client = new WebClient();
Byte[] buffer = client.DownloadData(fileToRenamePath);
if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
}
这在当前的浏览器打开该文件。