获取请求浏览器信息

复制代码
            System.Text.StringBuilder strLabel = new System.Text.StringBuilder();
            HttpBrowserCapabilities bc = Request.Browser;
            strLabel.Append("您的浏览器的分辨率为:");
            strLabel.Append(Request.Form["WidthPixel"]);
            strLabel.Append("×");
            strLabel.Append(Request.Form["HeightPixel"]);
            strLabel.Append("");
            strLabel.Append("浏览器基本信息:");
            strLabel.Append("Type = " + bc.Type + "");
            strLabel.Append("Name = " + bc.Browser + "");
            strLabel.Append("Version = " + bc.Version + "");
            strLabel.Append("Major Version = " + bc.MajorVersion + "");
            strLabel.Append("Minor Version = " + bc.MinorVersion + "");
            strLabel.Append("Platform = " + bc.Platform + "");
            strLabel.Append("Is Beta = " + bc.Beta + "");
            strLabel.Append("Is Crawler = " + bc.Crawler + "");
            strLabel.Append("Is AOL = " + bc.AOL + "");
            strLabel.Append("Is Win16 = " + bc.Win16 + "");
            strLabel.Append("Is Win32 = " + bc.Win32 + "");
            strLabel.Append("支持 Frames = " + bc.Frames + "");
            strLabel.Append("支持 Tables = " + bc.Tables + "");
            strLabel.Append("支持 Cookies = " + bc.Cookies + "");
            strLabel.Append("支持 VB Script = " + bc.VBScript + "");
            strLabel.Append("支持 JavaScript = " + bc.JavaScript + "");
            strLabel.Append("支持 Java Applets = " + bc.JavaApplets + "");
            strLabel.Append("支持 ActiveX Controls = " + bc.ActiveXControls + "");
            strLabel.Append("CDF = " + bc.CDF + "");
            strLabel.Append("W3CDomVersion = " + bc.W3CDomVersion.ToString() + "");
            strLabel.Append("UserAgent = " + Request.UserAgent + "");
            strLabel.Append("UserLanguages = " + Request.UserLanguages[0].ToString() + "");
            strLabel.Append("");
            strLabel.Append("客户端计算机基本配置:");
            strLabel.Append("UserHostName = " + Request.UserHostName + "");
            strLabel.Append("UserHostAddress = " + Request.UserHostAddress + "");
            strLabel.Append("PDF 6.0 插件是否安装 = " + Request.Form["PDF"] + "");
            string str= strLabel.ToString();
复制代码

 

posted @   肥大头  阅读(233)  评论(0编辑  收藏  举报
编辑推荐:
· ASP.NET Core 模型验证消息的本地化新姿势
· 对象命名为何需要避免'-er'和'-or'后缀
· SQL Server如何跟踪自动统计信息更新?
· AI与.NET技术实操系列:使用Catalyst进行自然语言处理
· 分享一个我遇到过的“量子力学”级别的BUG。
阅读排行:
· 为什么AI教师难以实现
· 如何让低于1B参数的小型语言模型实现 100% 的准确率
· AI Agent爆火后,MCP协议为什么如此重要!
· 【译】Visual Studio(v17.13)中新的调试和分析特性
· Draw.io:你可能不知道的「白嫖级」图表绘制神器
点击右上角即可分享
微信分享提示