📄 global.asax
字号:
<%@ Import namespace="System.Diagnostics" %>
<Script language="C#" runat=server>
public void Application_OnResolveRequestCache(){
Response.Write("served from cache...<hr size=1>");
}
public void Application_OnUpdateRequestCache(){
WriteLog("Updating cache...");
}
static private void WriteLog(String message){
String logname = "Web_Errors";
if (!EventLog.SourceExists(logname))
EventLog.CreateEventSource(logname, logname);
EventLog l = new EventLog();
l.Source = logname;
l.WriteEntry(message, EventLogEntryType.Information);
}
</Script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -