现在的位置: 首页 > 综合 > 正文

.net 获取服务器配置参数

2018年02月11日 ⁄ 综合 ⁄ 共 491字 ⁄ 字号 评论关闭

服务器名:    <%=System.Environment.MachineName%>

服务器端口: <%= HttpContext.Current.Request.ServerVariables["Server_Port"].ToString() %>

脚本解释引擎:<%=System.Environment.Version%>

站点物理路径:<%=HttpContext.Current.Request.PhysicalApplicationPath.ToString() %>

服务器CPU个数:<%=System.Environment.ProcessorCount %>
服务器IIS版本:<%=Request.ServerVariables["SERVER_SOFTWARE"]%>

开机运行时长:<%=(System.Environment.TickCount/3600000).ToString("N2")%>  小时

服务器时间:<%=DateTime.Now.ToString() %>

服务器操作系统:<%=System.Environment.OSVersion.ToString()%>

抱歉!评论已关闭.