Powered by:HDLabBBS V4.0.3 Access Shared 简体中文版
Copyright ©2005 - 2008 CodePlus.Net
页面执行时间:0.015625秒 ,查询数据库2次。
系统共占用内存3,537 KB。
Copyright ©2005 - 2008 CodePlus.Net
页面执行时间:0.015625秒 ,查询数据库2次。
系统共占用内存3,537 KB。
'获取映射到进程上下文的物理内存量
<add name="ProcessingTime" type="XXX.ProcessingTime, XXX"/>
</httpModules>
//Class=========
public class ProcessingTime : IHttpModule
{
private DateTime dtStartTime; public ProcessingTime()
{
} public void Init(HttpApplication app)
{
app.BeginRequest += new EventHandler(app_BeginRequest);
app.EndRequest += new EventHandler(app_EndRequest);
} public void Dispose()
{
} private void app_BeginRequest(object sender, EventArgs e)
{
dtStartTime = DateTime.Now;
} private void app_EndRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender; string strExpendTime = (DateTime.Now - dtStartTime).TotalMilliseconds.ToString();
strExpendTime = strExpendTime.Substring(0,strExpendTime.IndexOf(".") + 2); GC.Collect();
if (app.Context.Request.RawUrl.ToLower().IndexOf(".aspx") != -1)
{
app.Response.Write("<div align=\"center\">processing time:" + strExpendTime + " ms | using memory:" + GC.GetTotalMemory(true).ToString("###,###") + "</div>");
}
}
}
请问 xxx 应该是什么啊?
我是新手:(
XXX是你的命名空间???