我已经准备了两幅图片,分别为1024*768,800*600。如何在index.aspx页面里边根据显示器分辨率的不同而调用相应的图片呢?

解决方案 »

  1.   

    System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width//显示器的宽度
    System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height//显示器高度然后就是你的处理代码啦
      

  2.   

    楼上的没说到重点呀。我已经得到当前的分辨率啦。问题是在知道当前条件时,如何做相应的处理?也就是提取相应的图片。
    <script language="javascript">
     if(screen.width == "1280")
       {
         替换当前图片的路径
        }
     else
       {
         location="Login.aspx"
        }
    </script>
      

  3.   

    可以把这两个图片路径保存在WebConfig里,分情况动态调用.