This ASP program can display the screen resolution of the IE.NC client

Source: Internet
Author: User
Tags servervariables client
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%>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.