添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
System.Net.WebClient wb = new System.Net.WebClient();
//檔案路徑
string link = "http://localhost:56303/TempWebsite/Areas/DownloadPDF/Test.pdf";
Response.ClearHeaders();
Response.Clear();
Response.Expires = 0;
Response.Buffer = true;
Response.AddHeader("Accept-Language", "zh-tw");
Response.AddHeader("Content-Disposition", "Attachment;FileName=" + System.Web.HttpUtility.UrlEncode("測試PDF.pdf", System.Text.Encoding.UTF8));
Response.ContentType = "Application/pdf";
Response.BinaryWrite(wb.DownloadData(link));
Response.End();