查看主机的内存使用情况
程序员文章站
2023-02-18 14:24:37
888.net>https://www.asp888.net 豆腐技术站这个是我在国外的一个站点上看到的使用asp.net得到一些变量的程序,大家可以看看,其实这个程序没有多大的用...
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>
这个是我在国外的一个站点上看到的使用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>
上一篇: 苹果遥遥领先:iPad称霸平板市场 产品线即将更新
下一篇: 万历皇帝24年不上早朝,为什么没人*?