当前位置: 编程技术>.net/c#/asp.net
Asp.net获取浏览器信息的简单代码
来源: 互联网 发布时间:2014-08-30
本文导语: 在C#中,获取浏览器信息,大多使用到System.Web.HttpBrowserCapabilities类。 例子, 代码示例: //获取浏览器信息 //www. protected void Button1_Click(object sender, EventArgs e) { System.Web.HttpBrowserCapabilities browser = Request.Browser; string s = "Browser Ca...
在C#中,获取浏览器信息,大多使用到System.Web.HttpBrowserCapabilities类。
例子,
代码示例:
//获取浏览器信息
//www.
protected void Button1_Click(object sender, EventArgs e)
{
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string s = "Browser Capabilites
"
+ "Type=" + browser.Type + "
"
+ "Name=" + browser.Browser + "
"
+ "Version=" + browser.Version + "
"
+ "Majior Version=" + browser.MajorVersion + "
"
+ "Platform=" + browser.Platform + "
"
+ "Is Beta=" + browser.Beta + "
"
+ "Is AOL=" + browser.AOL + "
"
+ "Is Crawler=" + browser.Crawler + "
"
+ "is Win16=" + browser.Win16 + "
"
+ "is Win32=" + browser.Win32 + "
"
+ "Supports Frames=" + browser.Frames + "
"
+ "Supports Tables=" + browser.Tables + "
"
+ "Supports Cookies=" + browser.Cookies + "
"
+ "Supports VBScript=" + browser.VBScript + "
"
+ "Supports javaScript=" + browser.JavaScript + "
"
+ "Supports JavaApplets=" + browser.JavaApplets + "
"
+ "Supports ActiveX Controls=" + browser.ActiveXControls + "
";
Response.Write(s);
}
//www.
protected void Button1_Click(object sender, EventArgs e)
{
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string s = "Browser Capabilites
"
+ "Type=" + browser.Type + "
"
+ "Name=" + browser.Browser + "
"
+ "Version=" + browser.Version + "
"
+ "Majior Version=" + browser.MajorVersion + "
"
+ "Platform=" + browser.Platform + "
"
+ "Is Beta=" + browser.Beta + "
"
+ "Is AOL=" + browser.AOL + "
"
+ "Is Crawler=" + browser.Crawler + "
"
+ "is Win16=" + browser.Win16 + "
"
+ "is Win32=" + browser.Win32 + "
"
+ "Supports Frames=" + browser.Frames + "
"
+ "Supports Tables=" + browser.Tables + "
"
+ "Supports Cookies=" + browser.Cookies + "
"
+ "Supports VBScript=" + browser.VBScript + "
"
+ "Supports javaScript=" + browser.JavaScript + "
"
+ "Supports JavaApplets=" + browser.JavaApplets + "
"
+ "Supports ActiveX Controls=" + browser.ActiveXControls + "
";
Response.Write(s);
}