• HttpBrowserCapabilities使用获取浏览器信息


    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpBrowserCapabilities hbcMyBrower = new HttpBrowserCapabilities();
            hbcMyBrower = Request.Browser;

            //测试浏览器类型
            Response.Write("浏览器类型是:" + hbcMyBrower.Type);

            Response.Write("<br>");
            Response.Write("浏览器是否是AOL浏览器:" + hbcMyBrower.AOL);

            Response.Write("<br>");
            Response.Write("浏览器是否能语音呼叫:" + hbcMyBrower.CanInitiateVoiceCall);

            Response.Write("<br>");
            Response.Write("浏览器是否支持HTML播放背景音乐:" + hbcMyBrower.BackgroundSounds);

            Response.Write("<br>");
            Response.Write("浏览器是否是测试版:" + hbcMyBrower.Beta);


            Response.Write("<br>");
            Response.Write("浏览器是否支持多个卡片组:" + hbcMyBrower.CanCombineFormsInDeck);
            //测试浏览器是否支持ActiveX
            Response.Write("<br>");
            Response.Write("浏览器是否支持ActiveX控件:" + hbcMyBrower.ActiveXControls);

            Response.Write("<br>");
            Response.Write("支持用http获取XML吗?:" + hbcMyBrower.SupportsXmlHttp);

            Response.Write("<br>");
            Response.Write("浏览器是否支持Cookies:" + hbcMyBrower.Cookies);

            Response.Write("<br>");
            Response.Write("浏览器是否是Web爬行遍历搜索引擎:" + hbcMyBrower.Crawler);

            Response.Write("<br>");
            Response.Write("浏览器一个窗口所允许的提交按钮个数:" + hbcMyBrower.DefaultSubmitButtonLimit);

            Response.Write("<br>");
            Response.Write("浏览器ECMAScript版本号:" + hbcMyBrower.EcmaScriptVersion);

            Response.Write("<br>");
            Response.Write("获取.NET安装版本:" + hbcMyBrower.ClrVersion);

           // Response.Write("<br>");
            //Response.Write("获取.NET所有安装版本:" + hbcMyBrower.GetClrVersions);

            Response.Write("<br>");
            Response.Write("浏览器是否具有专用的上一步按钮:" + hbcMyBrower.HasBackButton);

            Response.Write("<br>");
            Response.Write("浏览器内部标识号:" + hbcMyBrower.Id);

            Response.Write("<br>");
            Response.Write("浏览器支持的输入类型:" + hbcMyBrower.InputType);

            Response.Write("<br>");
            Response.Write("浏览器是否具有颜色显示:" + hbcMyBrower.IsColor);

            Response.Write("<br>");
            Response.Write("浏览器是否支持JAVA:" + hbcMyBrower.JavaApplets);

            Response.Write("<br>");
            Response.Write("浏览器是否支持JAVAScript:" + hbcMyBrower.JavaScript);

            Response.Write("<br>");
            Response.Write("浏览器的整个版本号:" + hbcMyBrower.Version);
        }
    }

  • 相关阅读:
    EBS接口程序调试
    FORM级别和数据库级别的Trace
    详解EBS接口开发之供应商导入(补充)--供应商银行账户更新
    详解EBS接口开发之库事务处理带提前发运通知(ASN)采购接收入库-补充
    详解EBS接口开发之库存事务处理采购接收--补充
    采购接收会计期间未打开报错分析
    供应商默认发运地和开票地更新
    Linux下which、whereis、locate、find 命令查找文件
    sql AND 和 OR 运算符用于基于一个以上的条件对记录进行过滤
    premake构造工具
  • 原文地址:https://www.cnblogs.com/forever4444/p/1521419.html
Copyright © 2020-2023  润新知