在JS中:
WindowHeight= window.screen.height
WindowWidth= window.screen.width
在VB中:
Public Function ScreenH() As Integer '得到屏幕高
ScreenH = Screen.Height / Screen.TwipsPerPixelY
End Function
Public Function ScreenW() As Integer '得到屏幕宽
ScreenW = Screen.Width / Screen.TwipsPerPixelX
End Function
Private Sub Command1_Click()
MsgBox "当前分辨率:" + Str(ScreenW) + "x" + Str(ScreenH)
End Sub
在ASP中:
<%
select case request.servervariables("http_ua_pixels")
case "800*600"
...
case "640*480"
...
case "1024*768"
...
case else
...
end select
%>
<Script>
with (document) {
write ("您的屏幕显示设定值如下:<P>");
write ("屏幕的实际高度为", screen.availHeight, "<BR>");
write ("屏幕的实际宽度为", screen.availWidth, "<BR>");
write ("屏幕的色盘深度为", screen.colorDepth, "<BR>");
write ("屏幕区域的高度为", screen.height, "<BR>");
write ("屏幕区域的宽度为", screen.width);
}
</Script>
request.servervariables("http_ua_pixels")
没有返回值,有高人说只有IE3和4有。???