获取客户端浏览器信息

 

protected void Page_Load(object sender, EventArgs e)
    {
        HttpBrowserCapabilities bc = new HttpBrowserCapabilities();
        bc = Request.Browser;

        Response.Write("<p>浏览器属性:</p>");
        Response.Write("浏览器型号   =   " + bc.Type + "<br/>");
        Response.Write("浏览器名称 =   " + bc.Browser + "<br/>");
        Response.Write("浏览器版本   =   " + bc.Version + "<br/>");
        Response.Write("主版本号   =   " + bc.MajorVersion + "<br/>");
        Response.Write("从版本号   =   " + bc.MinorVersion + "<br/>");
        Response.Write("操作系统   =   " + bc.Platform + "<br/>");
        Response.Write("是否试用版   =   " + bc.Beta + "<br/>");
        Response.Write("Is   Crawler   =   " + bc.Crawler + "<br/>");
        Response.Write("Is   AOL   =   " + bc.AOL + "<br/>");
        Response.Write("16位机   =   " + bc.Win16 + "<br/>");
        Response.Write("32位机   =   " + bc.Win32 + "<br/>");
        Response.Write("支持Frame   =   " + bc.Frames + "<br/>");
        Response.Write("支持Table   =   " + bc.Tables + "<br/>");
        Response.Write("支持Cookies   =   " + bc.Cookies + "<br/>");
        Response.Write("支持VB   Script   =   " + bc.VBScript + "<br/>");
        Response.Write("支持   JavaScript   =   " + bc.JavaScript + "<br/>");
        Response.Write("支持   Java   Applets   =" + bc.JavaApplets + "<br/>");
        Response.Write("支持   ActiveXControls   =   " + bc.ActiveXControls + "<br/>");
        Response.Write("电台CDF   =   " + bc.CDF + "<br/>");
        Response.Write(Request.UserAgent);
        Response.Write("<scriptlanguage='javascript'>//读屏幕的大小screenWidth=screen.width;screenHeight=screen.height;</script>");
        //屏幕分辨率的高:Response.Write(window.screen.height);
        //屏幕分辨率的宽:"+window.screen.width;
        //屏幕可用工作区高度:"+window.screen.availHeight;
        //屏幕可用工作区宽度:"+window.screen.availWidth
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值