手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >asp.net显示页面执行时间
asp.net显示页面执行时间
摘要:复制代码代码如下:protectedvoidApplication_BeginRequest(Objectsender,EventArgse...

复制代码 代码如下:

protected void Application_BeginRequest(Object sender, EventArgs e)

{

Application["StartTime"] = System.DateTime.Now;

}

protected void Application_EndRequest(Object sender, EventArgs e)

{

System.DateTime startTime = (System.DateTime)Application["StartTime"];

System.DateTime endTime = System.DateTime.Now;

System.TimeSpan ts = endTime - startTime;

Application["runtime"] = (Convert.ToDouble((ts.Milliseconds)) / 1000);

}

在要显示的地方: 页面执行时间:

复制代码 代码如下:

<%=Convert.ToString(Application["runtime"]) %>

【asp.net显示页面执行时间】相关文章:

asp.net gridview多页时的批量删除

asp.net gridview 72般绝技第1/2页

asp.net C#检查URL是否有效的方法

asp.net Google样式分页控件

asp.net 大文件上传控件

asp.net输出重写压缩页面文件实例代码

asp.net跳转页面的三种方法比较

asp.net刷新本页面的六种方法

asp.net 两个不同页面的传值

asp.net 继承自Page实现统一页面验证与错误处理

精品推荐
分类导航