文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>获取服务器配置信息

获取服务器配置信息

时间:2010-11-09  来源:〤‵坠落者...

 

 

 <table cellspacing="1" cellpadding="3" width="90%" align="center" bgcolor="#ffffff"
                border="0">
                <tbody>
                    <tr>
                        <td class="th1" align="center" colspan="2" height="25">
                            服务器信息统计
                        </td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td style=" width: 50%; text-align: left;">
                            &nbsp;<strong>服务器名</strong>:<%=System.Environment.MachineName%></td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td width="50%" style=" text-align: left;">
                            &nbsp;<b>服务器端口:</b><%= HttpContext.Current.Request.ServerVariables["Server_Port"].ToString() %></td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td style=" width: 50%; text-align: left;">
                            &nbsp;<b>脚本解释引擎:</b><%=System.Environment.Version%></td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td width="50%" style=" text-align: left;">
                            <b>&nbsp;站点物理路径:</b><%=HttpContext.Current.Request.PhysicalApplicationPath.ToString() %></td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td style=" width: 50%; text-align: left;">
                            &nbsp;<b>服务器CPU个数:</b><%=System.Environment.ProcessorCount %>
                        </td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td width="50%" style=" text-align: left;">
                            &nbsp;<b>服务器IIS版本:</b><%=Request.ServerVariables["SERVER_SOFTWARE"]%></td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td style="width: 50%; text-align: left;">
                            &nbsp;<b>开机运行时长</b>:<%=(System.Environment.TickCount/3600000).ToString("N2")%>
                            小时
                        </td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td width="50%" style=" text-align: left;">
                            <b>&nbsp;服务器时间:</b><%=DateTime.Now.ToString() %></td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td width="50%" style=" text-align: left;">
                            <b>&nbsp;服务器变量:</b>Session(<%=Session.Contents.Count%>) Application(<%
                                                                                                    if (Application.Contents.Count > 2)
                                                                                                    {
                                                                                                        Response.Write(Application.Contents.Count - 2);
                                                                                                    }
                                                                                                    else
                                                                                                    {
                                                                                                        Response.Write(Application.Contents.Count);
                                                                                                    }
                            %>)</td>
                    </tr>
                    <tr bgcolor="#f9fbf0">
                        <td colspan="2" style=" text-align: left;">
                            &nbsp;<b>服务器操作系统:</b><span>
                                <%=System.Environment.OSVersion.ToString()%>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载