ASP.NET中如何获取客户端浏览器信息

 1         HttpBrowserCapabilities bc = Request.Browser;
 2         
 3         list.Text = "";
 4         list.Text += "操作系统:" + bc.Platform + "<br>";
 5         list.Text += "是否是 Win16 系统:" + bc.Win16 + "<br>";
 6         list.Text += "是否是 Win32 系统:" + bc.Win32 + "<br>";
 7         list.Text += "---<br>";
 8         
 9         list.Text += "浏览器:" + bc.Browser + "<br>";
10         list.Text += "浏览器标识:" + bc.Id + "<br>";
11         list.Text += "浏览器版本:" + bc.Version + "<br>";
12         list.Text += "浏览器 MajorVersion:" + bc.MajorVersion.ToString() + "<br>";
13         list.Text += "浏览器 MinorVersion:" + bc.MinorVersion.ToString() + "<br>";
14         list.Text += "浏览器是否是测试版本:" + bc.Beta.ToString() + "<br>";
15         list.Text += "是否是 America Online 浏览器:" + bc.AOL + "<br>";
16         list.Text += "客户端安装的 .NET Framework 版本:" + bc.ClrVersion + "<br>"//即使安装了 .NET Framework,如果不是 IE 浏览器,检测版本都是 0.0。
17         list.Text += "是否是搜索引擎的网络爬虫:" + bc.Crawler + "<br>";
18         list.Text += "是否是移动设备:" + bc.IsMobileDevice + "<br>";
19         list.Text += "---<br>";         
20 
21         list.Text += "显示的颜色深度:" + bc.ScreenBitDepth + "<br>";
22         list.Text += "显示的近似宽度(以字符行为单位):" + bc.ScreenCharactersWidth + "<br>";
23         list.Text += "显示的近似高度(以字符行为单位):" + bc.ScreenCharactersHeight + "<br>";
24         list.Text += "显示的近似宽度(以像素行为单位):" + bc.ScreenPixelsWidth + "<br>";
25         list.Text += "显示的近似高度(以像素行为单位):" + bc.ScreenPixelsHeight + "<br>";
26         list.Text += "---<br>";
27         
28         list.Text += "是否支持 CSS:" + bc.SupportsCss + "<br>";
29         list.Text += "是否支持 ActiveX 控件:" + bc.ActiveXControls.ToString() + "<br>";
30         list.Text += "是否支持 JavaApplets:" + bc.JavaApplets.ToString() + "<br>";
31         list.Text += "是否支持 JavaScript:" + bc.JavaScript.ToString() + "<br>";
32         list.Text += "JScriptVersion:" + bc.JScriptVersion.ToString() + "<br>";
33         list.Text += "是否支持 VBScript:" + bc.VBScript.ToString() + "<br>";
34         list.Text += "是否支持 Cookies:" + bc.Cookies + "<br>";
35         list.Text += "支持的 MSHTML 的 DOM 版本:" + bc.MSDomVersion + "<br>";
36         list.Text += "支持的 W3C 的 DOM 版本:" + bc.W3CDomVersion + "<br>";
37         list.Text += "是否支持通过 HTTP 接收 XML:" + bc.SupportsXmlHttp + "<br>";
38         list.Text += "是否支持框架:" + bc.Frames.ToString() + "<br>";
39         list.Text += "超链接 a 属性 href 值的最大长度:" + bc.MaximumHrefLength + "<br>";
40         list.Text += "是否支持表格:" + bc.Tables + "<br>";
41 

 

posted @ 2010-05-12 10:51  SoLo.  阅读(1327)  评论(0)    收藏  举报