我想编写一个模块来记录站点中的所有错误。请指导我。
最佳答案
全局.asax:
<%@ Application Inherits="MyProj.Global" %>
Global.asax.cs:
namespace MyProj
{
public class Global : HttpApplication
{
protected virtual void Application_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError().GetBaseException();
}
}
}
关于c# - 如何记录站点中发生的所有错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4756598/