Http://www.asp888.net bean curd technology station
This is a program that I saw on a foreign site using Asp. Net to get some system variables,
Let's take a look. In fact, this program is not very useful. It just describes the powerful functions of asp. Net.
<Script language = "C #" runat = server>
Void Page_Load (Object sender, EventArgs ev)
{
ProcessInfo [] history = ProcessModelInfo. GetHistory (100 );
For (int I = 0; I {
Response. Write ("StartTime:" + history [I]. StartTime. ToString () + "<BR> ");
Response. Write ("Age:" + history [I]. Age. ToString () + "<BR> ");
Response. Write ("ProcessID:" + history [I]. ProcessID. ToString () + "<BR> ");
Response. Write ("RequestCount:" + history [I]. RequestCount. ToString () + "<BR> ");
Response. Write ("Status:" + GetProcessStatus (history [I]. Status) + "<BR> ");
Response. Write ("ShutdownReason:" + GetShutdownReason (history [I]. ShutdownReason) + "<BR> ");
Response. Write ("PeakMemoryUsed:" + history [I]. PeakMemoryUsed. ToString () + "<BR> ");
}
}
Public String GetProcessStatus (ProcessStatus ps)
{
String s = "Unknown ";
If (ps = ProcessStatus. Alive)
S = "Alive ";
Else if (ps = ProcessStatus. ShuttingDown)
S = "Shutting Down ";
Else if (ps = ProcessStatus. ShutDown)
S = "Shutdown ";
Else if (ps = ProcessStatus. Terminated)
S = "Terminated ";
Return s;
}
Public String GetShutdownReason (ProcessShutdownReason psr)
{
String s = "Unknown ";
If (psr = ProcessShutdownReason. None)
S = "N/";
Else if (psr = ProcessShutdownReason. Unexpected)
S = "Unexpected ";
Else if (psr = ProcessShutdownReason. RequestsLimit)
S = "Requests Limit ";
Else if (psr = ProcessShutdownReason. RequestQueueLimit)
S = "Request Queue Limit ";
Else if (psr = ProcessShutdownReason. Timeout)
S = "Timeout ";
Else if (psr = ProcessShutdownReason. IdleTimeout)
S = "Idle Timeout ";
Else if (psr = ProcessShutdownReason. MemoryLimitExceeded)
S = "Memory Limit Exceeded ";
Return s;
}
</Script>