在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
%>