<SCRIPT type = "text/JavaScript">
// <! --
If (window. Navigator. useragent. indexof ("MSIE")> = 1 ){
// If the browser is IE
Setactivestylesheet ("browser.css ");
} Else {
If (window. Navigator. useragent. indexof ("Firefox")> = 1 ){
// If the browser is Firefox
Setactivestylesheet ("default2.css ");
} Else {
// If the browser is other
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 ){
// If the browser is IE
If (window. Navigator. useragent. indexof ("MSIE 6.0")> = 1)
{
Document. Write ("your browser is 60 ");
}
If (window. Navigator. useragent. indexof ("MSIE 7.0")> = 1)
{
Document. Write ("your browser is 70 ");
}
// Setactivestylesheet ("browser.css ");
} Else {
If (window. Navigator. useragent. indexof ("Firefox")> = 1 ){
// If the browser is Firefox
Setactivestylesheet ("default2.css ");
} Else {
// If the browser is other
Setactivestylesheet ("newsky.css ");}
}
Function setactivestylesheet (title ){
Document. Write ("<link href = '" + title + "'Type = 'text/CSS' rel = 'stylesheet '> ");
}
// -->
</SCRIPT>
Protected void button#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 );
}