http://www.chinese-s.adobe.com/main.html (http://www.adobe.com)
2、确保将您的页面添加到项目中在上一节中添加的 .pdf 文件所在的级别。这一点非常重要,因为代码最初引用 .pdf 文件时采用相对路径。
在代码隐藏页的 Page_Load 事件中,单击“编辑”菜单上的“粘贴”以粘贴代码:
2、确保将您的页面添加到项目中在上一节中添加的 .pdf 文件所在的级别。这一点非常重要,因为代码最初引用 .pdf 文件时采用相对路径。
在代码隐藏页的 Page_Load 事件中,单击“编辑”菜单上的“粘贴”以粘贴代码:
在代码隐藏页的 Page_Load 事件中,加入以下代码: private void Page_Load(object sender, System.EventArgs e)
{ //Set the appropriate ContentType. Response.ContentType = "Application/pdf"; //Get the physical path to the file. string FilePath = MapPath("acrobat.pdf"); //Write the file directly to the HTTP content output stream. Response.WriteFile(FilePath); Response.End(); } |