62,241
社区成员




#region 本页面打开
//string file_path = Server.MapPath("pagetohtml.pdf");
//Response.ClearContent();
//Response.ClearHeaders();
//Response.ContentType = "application/PDF";
//Response.WriteFile(file_path);
//Response.Flush();
//Response.Close();
//Session.Remove("Report");
#endregion
#region 提供下载和保存
//string fPath = Path.Combine(Server.MapPath(""), "pagetohtml.pdf");
//FileStream fFileStream = new FileStream(fPath, FileMode.Open);
//long fFileSize = fFileStream.Length;
//Context.Response.ContentType = "application/octet-stream";
//Context.Response.AddHeader("Content-Disposition", "attachment; filename=\"" + HttpUtility.UrlEncode(Path.GetFileName(fPath), System.Text.Encoding.UTF8) + "\"");
//Context.Response.AddHeader("Content-Length", fFileSize.ToString());
//byte[] fFileBuffer = new byte[fFileSize];
//fFileStream.Read(fFileBuffer, 0, (int)fFileSize);
//fFileStream.Close();
//Context.Response.BinaryWrite(fFileBuffer);
//Context.Response.End();
#endregion