using System;
using System.Web;
using System.IO;
namespace GridView入庫單管理
{
public partial class Error : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Exception ex = HttpContext.Current.Server.GetLastError(); //獲取錯誤對象;
string line = "------------------------------------------------------------------------------";
File.AppendAllText(Server.MapPath("~/Log.txt"), ex.Message + ex.StackTrace + "\n" + DateTime.Now + "\n" + line);
}
}
}
}
文件不存在。 在 System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)
在 System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath)
在 System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2011-05-18 18:19:03
--------------------------------------------------------