ASP.Net/Development/Process Info

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Get Process Model Info (C#)

<html>
<head>
<title>ASP.NET Process Info</title>
</head>
<body>
<script Language="c#" runat=server>
void Page_Load(object sender, EventArgs e)
{
  ProcessInfo[] history = ProcessModelInfo.GetHistory(10);
  for(int i = 0; i< history.Length; i++)
  {
     Response.Write ("<table border>");
     Response.Write ("<tr><td>ASP.NET Process Start Date and Time<td>" + 
                     history[i].StartTime.ToString());
     Response.Write ("<tr><td>Process Age ( HH:MM:SS:LongDecimal )<td>" + 
                     history[i].Age.ToString());
     Response.Write ("<tr><td>Process ID ( The same as in Task Manager )<td>" + 
                     history[i].ProcessID.ToString());
     Response.Write ("<tr><td>Total Request Count (Requests served since the " + 
                    "process started)<TD>" + history[i].RequestCount.ToString());
     Response.Write ("<tr><td>Peak Memory Used ( KB ) <td>" + 
                     history[i].PeakMemoryUsed.ToString());
     Response.Write ("</table>");
  }
}
</script>
</body>
</html>