Global.asax.cs中:  
       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;
            Response.Write(
"<table   border=0'   width='100%'><tr><td   align='center'   width='100%'><font   size=1   color='red'>页面执行耗时:" + ts + "秒<font></td></tr></table>");

        }

 

相关文章:

  • 2021-06-20
  • 2021-08-24
  • 2021-10-18
  • 2022-12-23
  • 2021-12-24
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-28
  • 2022-02-14
  • 2022-01-22
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案