博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Asp.net获取浏览器信息

Posted on 2010-12-05 21:13  Sky_KWolf  阅读(1342)  评论(0编辑  收藏  举报

获取浏览器信息主要用到System.Web.HttpBrowserCapabilities类。

 

代码
protected void Button1_Click(object sender, EventArgs e)
{
System.Web.HttpBrowserCapabilities browser
= Request.Browser;
string s = "Browser Capabilites<br/>"
+ "Type=" + browser.Type + "<br/>"
+ "Name=" + browser.Browser + "<br/>"
+ "Version=" + browser.Version + "<br/>"
+ "Majior Version=" + browser.MajorVersion + "<br/>"
+ "Platform=" + browser.Platform + "<br/>"
+ "Is Beta=" + browser.Beta + "<br/>"
+ "Is AOL=" + browser.AOL + "<br/>"
+ "Is Crawler=" + browser.Crawler + "<br/>"
+ "is Win16=" + browser.Win16 + "<br/>"
+ "is Win32=" + browser.Win32 + "<br/>"
+ "Supports Frames=" + browser.Frames + "<br/>"
+ "Supports Tables=" + browser.Tables + "<br/>"
+ "Supports Cookies=" + browser.Cookies + "<br/>"
+ "Supports VBScript=" + browser.VBScript + "<br/>"
+ "Supports javaScript=" + browser.JavaScript + "<br/>"
+ "Supports JavaApplets=" + browser.JavaApplets + "<br/>"
+ "Supports ActiveX Controls=" + browser.ActiveXControls + "<br/>";

Response.Write(s);

}