“/”应用程序中的服务器错误。

未能找到路径“D:\正式网站\应用昆虫学报\articles\2004年第6期\04060552.pdf”的一部分。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.IO.DirectoryNotFoundException: 未能找到路径“D:\正式网站\应用昆虫学报\articles\2004年第6期\04060552.pdf”的一部分。

源错误:


行 41:                     if (dr["pdfurl"].ToString().Trim().Length > 0)
行 42:                     {
行 43:                         byte[] buffer = File.ReadAllBytes(Server.MapPath("../"+getpdfurl()));
行 44:                         Response.ContentType = "application/pdf";
行 45:                         Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(dr["pdfurl"].ToString()));

源文件: d:\正式网站\应用昆虫学报\admin\downfile.aspx.cs    行: 43

堆栈跟踪:


[DirectoryNotFoundException: 未能找到路径“D:\正式网站\应用昆虫学报\articles\2004年第6期\04060552.pdf”的一部分。]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +338
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1430
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +211
   System.IO.File.InternalReadAllBytes(String path, Boolean checkHost) +141
   admin_downfile.Page_Load(Object sender, EventArgs e) in d:\正式网站\应用昆虫学报\admin\downfile.aspx.cs:43
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.34009