当前位置: 移动技术网 > IT编程>开发语言>.net > 查看主机的内存使用情况

查看主机的内存使用情况

2019年01月13日  | 移动技术网IT编程  | 我要评论

山口里子,吉林省人口与计划生育条例,咸阳新闻网

888.net>https://www.asp888.net 豆腐技术站

这个是我在国外的一个站点上看到的使用asp.net得到一些变量的程序,
大家可以看看,其实这个程序没有多大的用处,只是说明一下asp.net 的强大功能而已。
<script language="c#" runat=server>
void page_load(object sender, eventargs ev)
{
processinfo[] history = processmodelinfo.gethistory(100);
for( int i=0; i<history.length; 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>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网