当前位置: 首页 > 图文教程 > 网络编程 > ASP > 查看主机的内存使用情况

ASP
FrontPage 2000+DB2实现数据库信息发布
Execel文件插入到ASP页面
利用ASP在客户端注册DLL文件
1栏分页显示(附显示的形式前页,后页)
1栏分页显示(附显示的形式[1][2])
一个基于web的QQ程序 2(xml+asp)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(一)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(二)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(三)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(四)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(五)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(六)
建立一个广告交换及跟踪系统
如何制作无状态的ASP组件
无组件文件上传代码实例
建立动态下拉式选单(三阶层)
用ASP编写的“俄罗斯方块游戏”
利用ASP.NET来访问Excel文档
初探SSI网页制作
具有自攻击性的代码

ASP 中的 查看主机的内存使用情况


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 50 ::
收藏到网摘: n/a

  http://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>