This is what I see on a foreign site using asp.net to get some system variables,
We can see, in fact, this program is not much use, just to explain the powerful function 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/a";
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>