Program | resolution | client | Display requires the latest browscap.ini, or it will cause new browsers such as IE5,NC46 to run correctly.
<HTML>
<TITLE>detectres.asp</TITLE>
<%
Set BC = Server.CreateObject ("MSWC.") BrowserType ")
Brname=bc.browser
Brver=bc.version
%>
<% if Brname= "IE" and CInt (brver) >=4 Then
<body bgcolor=white onload= "doit ()" >
<script language=vbscript>
<!--
Sub doit ()
document.write "Your screen width is:" & screen.width & "Pixels<br>"
document.write "Your screen height is:" & screen.height & "Pixels<br>"
document.write "Your clientwidth is:" & Document.body.clientWidth
document.write "Pixels<br>"
document.write "Your clientheight is:" & Document.body.clientHeight
document.write "Pixels<br>"
' Add the rest of the ' the page ' s
' IE4 HTML code here...using document.write like:
document.write "<br><a href= ' blank.htm ' >blank link</a>"
End Sub
-->
</script>
' Any regular HTML code
' would disappear after the Document.writes
</body>
<% Else%>
<body bgcolor=white>
<% Response.Write "You ' re using" & Brname & ", Version #" & CInt (Brver) & "with"%>
<% if Brname= "IE" and CInt (brver) =3 Then
Pixels=request.servervariables ("Http_ua_pixels")
Color=request.servervariables ("Http_ua_color")
Response.Write "pixels=" & Pixels & ", colors=" & Colors
%>
<p>
' Add the rest of the page ' s IE3 html code here ...
</body>
<% End If%>
<% if Brname= "Netscape" and (CInt (brver) > 1) then%>
<body bgcolor=white>
<script language= "JavaScript" >
<!--
if (navigator.javaenabled ())
{
var tools=java.awt.toolkit.getdefaulttoolkit ();
var size=tools.getscreensize ();
W=size.width;
H=size.height;
}
document.write ("Screen Size:" + W + "X" + H + "pixels.");
-->
</script>
<% End If%>
<p>
' Add other Netscape HTML code here...like:
<br>
<a href= "blank.htm" >blank link</a>
</body>
<% End If%>