大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> NET专区 -> 用C#监视服务器信息

用C#监视服务器信息

时间: 2021-07-31 作者:daque

<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("<table border>"); response.write("<tr><td>"); response.write("starttime<td>"+ history[i].starttime.tostring() + "<br>"); response.write("<tr><td>"); response.write("age<td>"+ history[i].age.tostring() + "<br>"); response.write("<tr><td>"); response.write("processid<td>"+ history[i].processid.tostring() + "<br>"); response.write("<tr><td>"); response.write("requestcount<td>" + history[i].requestcount.tostring()+ "<br>"); response.write("<tr><td>"); response.write("status<td>" + getprocessstatus( history[i].status ) + "<br>"); response.write("<tr><td>"); response.write("shutdownreason<td>" + getshutdownreason( history[i].shutdownreason) + "<br>"); response.write("<tr><td>"); response.write("peakmemoryused<td>" + history[i].peakmemoryused.tostring()+ "<br>"); response.write("</table><p><p>");} } 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>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.