asp.net读取系统信息、程序集信息、模块信息

网站前台页面:


应用系统:<%=HttpRuntime.AppDomainAppVirtualPath %> <br />目录:<%=HttpRuntime.AppDomainAppPath %> <br />域名地址:<%=Request.ServerVariables["SERVER_NAME"] %>, <%=Request.ServerVariables["LOCAL_ADDR"]+":"+Request.ServerVariables["Server_Port"] %> <br />计算机名:<%=Environment.MachineName %> <br />用户名:<%=Environment.UserName %> <br />应用程序域:<%= AppDomain.CurrentDomain.FriendlyName %> <br /><br />程序集列表 <br />操作系统:<%=Environment.OSVersion %> <br />Web服务器:<%= Request.ServerVariables["Server_SoftWare"]%><%if (HttpRuntime.UsingIntegratedPipeline) { %> 集成管道<%} %> <br />系统版本:<%= Environment.Version%> <br />.Net 版本:<%= Environment.Version%> <br />当前时间:<%= DateTime.Now%> <br />开机时间:<%= new TimeSpan(Environment.TickCount)%> <br />CPU 总数:<%= Environment.ProcessorCount%>核心,<%= Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")%> <br />虚拟内存:<%= ((Double)Environment.WorkingSet / 1048576).ToString("n2") + "M"%> <br />当前占用:<%= ((Double)GC.GetTotalMemory(false) / 1048576).ToString("n2") + "M"%> <% System.Diagnostics.Process process = System.Diagnostics.Process.GetCurrentProcess(); %> <br />ASP.Net 内存:<%= ((Double)process.WorkingSet64 / 1048576).ToString("N2") + "M"%> <br /><br />模块列表 <br />ASP.Net CPU: <%= ((TimeSpan)process.TotalProcessorTime).TotalSeconds.ToString("N2")%>秒 启动于<%= process.StartTime%> <br />Session数:<%= Session.Contents.Count%>,<%= Session.Timeout%>分钟 <br />SessionID:<%= Session.Contents.SessionID%> <br />Cache数:<%= Cache.Count%> 可用:<%= ((Double)Cache.EffectivePrivateBytesLimit / 1048576).ToString("n2")%>M,<%= Cache.EffectivePercentagePhysicalMemoryLimit%>%
原文地址:https://www.cnblogs.com/ishibin/p/2662524.html