<%@ Page Language=”C#” %>
<%@ Import Namespace=”System.Web” %>
<%
    HttpBrowserCapabilities bc = new HttpBrowserCapabilities();
    bc = Request.Browser;
%>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head id=”Head1″ runat=”server”>
    <title>ASP.NET探针</title>

    <script type=”text/javascript”>
    var str_open = “Open”;
    var str_close = “Close”;
    function hide(goal, obj)
    {
        var id = $(goal);
        if(id.style.display != “none”)
        {
            id.style.display = “none”;
            obj.innerHTML = str_open;
        }
        else
        {
            id.style.display = “”;
            obj.innerHTML = str_close;
        }
    }
    function $(id)
    {
        if(typeof(id) == “string”)
            return document.getElementById(id);
        else
            return null;
    }
    </script>

    <style type=”text/css”>
    body
    {
        width: 800px;
        font-size: 12px;
        font-family: Arial;
        margin: 0 auto 0 auto;
        background-color: #fff;
        line-height: 200%;
    }
    div
    {
        width: 100%;
    }
    b
    {
        font-size: 14px;
        width: 200px;
        float: left;
    }
    ol
    {
        margin-top: 5px;
        margin-bottom: 5px;
    }
    .r
    {
        float: right;
    }
    .box
    {
        margin-top: 5px;
        border: solid 1px #aaa;
        float: left;
    }
    .box .tit
    {
        background-color: #aaa;
    }
    .o
    {
        border-top: solid 1px #fff;
        background-color: #eee;
    }
    .oo
    {
        border-top: solid 1px #fff;
        background-color: #ccc;
    }
    .cp
    {
        margin-top: 5px;
        border: solid 1px #ccc;
        background-color: #ccc;
        height: 50px;
        text-align: center;
        font-size:14px;
        float: left;
    }
    </style>
</head>
<body>
    <div>
        <div>
            出现以下情况表示服务器不支持 .NET Framework:
            <ol>
                <li>打开文件时提示下载</li>
                <li>无法看到具体的服务端以及客户端信息</li>
            </ol>
        </div>
        <div class=”box”>
            <div class=”tit”>
                <a href=”javascript:;” onclick=”hide(\’nw9th4ge\’, this)” class=”r”>

                    <script type=”text/javascript”>document.write(str_close);</script>

                </a>服务器端信息</div>
            <div id=”nw9th4ge”>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务器IP:</b><% =Request.ServerVariables[“LOCAL_ADDR”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务器名:</b><% =Request.ServerVariables[“SERVER_NAME”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>HTTP端口:</b><% =Request.ServerVariables[“SERVER_PORT”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务器时间:</b><% =DateTime.Now %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>操作系统信息:</b><% =Request.ServerVariables[“HTTP_USER_AGENT”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>允许文件:</b><% =Request.ServerVariables[“HTTP_ACCEPT”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>MD目录:</b><% =Request.ServerVariables[“APPL_MD_PATH”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>探针文件路径:</b><% =Server.MapPath(Request.ServerVariables[“SCRIPT_NAME”]) %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>IIS版本:</b><% =Request.ServerVariables[“SERVER_SOFTWARE”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>脚本超时时间(秒):</b><% =Server.ScriptTimeout%>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>SLL连接:</b><% =Request.ServerVariables[“HTTPS”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>CGI版本:</b><% =Request.ServerVariables[“GATEWAY_INTERFACE”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务端语言:</b><% =Request.ServerVariables[“HTTP_ACCEPT_LANGUAGE”] %>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>Framework版本:</b><%Response.Write(Environment.Version.ToString());%>
                </div>
                 <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务器系统版本:</b><%Response.Write(Environment.OSVersion.ToString());%>
                </div>
                 <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务器处理器个数:</b><%Response.Write(Environment.ProcessorCount.ToString());%>
                </div>
                <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                    <b>服务器物理内存:</b><%Response.Write(Environment.WorkingSet.ToString());%>
                </div>
            </div>
        </div>

        <div class=”box”>
            <div class=”tit”>
                <a href=”javascript:;” onclick=”hide(\’n34uhnib\’, this)” class=”r”>

                    <script type=”text/javascript”>document.write(str_close);</script>

                </a>客户端信息</div>
            <div id=”n34uhnib”>
                <div style=”float: left; width: 50%;”>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>浏览器类型:</b><% =bc.Type %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>浏览器名称:</b><% =bc.Browser %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>浏览器版本:</b><% =bc.Version %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>&nbsp;&nbsp;主版本:</b><% =bc.MajorVersion %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>&nbsp;&nbsp;次版本:</b><% =bc.MinorVersion %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否测试版本:</b><% =bc.Beta %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否客户平台:</b><% =bc.Platform %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否AOL 浏览器:</b><% =bc.AOL %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否基于Win16:</b><% =bc.Win16 %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否基于Win32:</b><% =bc.Win32 %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持框架:</b><% =bc.Frames %>
                    </div>
                </div>
                <div style=”float: left; width: 50%;”>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持表格:</b><% =bc.Tables %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持Cookies:</b><% =bc.Cookies %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持VB Script:</b><% =bc.VBScript %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持JavaScript:</b><% =bc.JavaScript %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持Java Applets:</b><% =bc.JavaApplets %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持Activex Controls:</b><% =bc.ActiveXControls %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持CDF:</b><% =bc.CDF %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>是否支持背景音乐:</b><% =bc.BackgroundSounds %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>ECMA 脚本版本:</b><% =bc.EcmaScriptVersion %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>MS DOM版本:</b><% =bc.MSDomVersion %>
                    </div>
                    <div class=”o” onmouseover=”this.className=\’oo\'” onmouseout=”this.className=\’o\'”>
                        <b>W3C DOM版本:</b><% =bc.W3CDomVersion %>
                    </div>
                </div>
            </div>
        </div>
</body>
</html>

版权声明:本文为MeChecksV原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/MeChecksV/articles/1425473.html