查看主机的内存使用情况
2018-09-06 11:41
这个是我在国外的一个站点上看到的使用Asp.Net得到一些系统变量的程序,
大家可以看看,其实这个程序没有多大的用处,只是说明一下的强大功能而已。
void Page_Load(Object sender, EventArgs ev)
{
ProcessInfo[] history = ProcessModelInfo.GetHistory(100);
for( int i=0; i<history.Length; i++ )
{
);
);
);
);
);
);
);
}
}
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;
s = Memory Limit Exceeded;
return s;
}
下一篇:ASP怎么谈到应用到类的?