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>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service