<script type="text/javascript">
//<!--
if (window.navigator.userAgent.indexOf("MSIE")>=1){
//如果浏览器为IE
setActiveStyleSheet("browser.css");
}else{
if (window.navigator.userAgent.indexOf("Firefox")>=1){
//如果浏览器为Firefox
setActiveStyleSheet("default2.css");
}else{
//如果浏览器为其他
setActiveStyleSheet("newsky.css");}
}
function setActiveStyleSheet(title){
document.write("<LINK href='"+title+"' type='text/css' rel='stylesheet'>");
}
//-->
</script>
<script type="text/javascript">
//<!--
if (window.navigator.userAgent.indexOf("MSIE")>=1){
//如果浏览器为IE
if (window.navigator.userAgent.indexOf("MSIE 6.0")>=1)
{
document.write("您的浏览器是60");
}
if (window.navigator.userAgent.indexOf("MSIE 7.0")>=1)
{
document.write("您的浏览器是70");
}
//setActiveStyleSheet("browser.css");
}else{
if (window.navigator.userAgent.indexOf("Firefox")>=1){
//如果浏览器为Firefox
setActiveStyleSheet("default2.css");
}else{
//如果浏览器为其他
setActiveStyleSheet("newsky.css");}
}
function setActiveStyleSheet(title){
document.write("<LINK href='"+title+"' type='text/css' rel='stylesheet'>");
}
//-->
</script>
protected void Button1_Click(object sender, EventArgs e)
{
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string s = "Browser Capabilities<br />"
+ "Type = " + browser.Type + "<br />"
+ "Name = " + browser.Browser + "<br />"
+ "Version = " + browser.Version + "<br />"
+ "Major Version = " + browser.MajorVersion + "<br />"
+ "Minor Version = " + browser.MinorVersion + "<br />"
+ "Platform = " + browser.Platform + "<br />"
+ "Is Beta = " + browser.Beta + "<br />"
+ "Is Crawler = " + browser.Crawler + "<br />"
+ "Is AOL = " + browser.AOL + "<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.EcmaScriptVersion.ToString() + "<br />"
+ "Supports Java Applets = " + browser.JavaApplets + "<br />"
+ "Supports ActiveX Controls = " + browser.ActiveXControls
+ "<br />";
Response.Write(s);
}