如何在ASP.NET端获取屏幕宽度

using System.Windows.Forms;

首先引用上面的命名空间。

然后在代码中获取屏幕信息。如下代码:

   System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.PrimaryScreen; System.Drawing.Rectangle rct = screen.Bounds;
            int width= screen.WorkingArea.Width;

 

posted @ 2013-10-18 16:54  小傻瓜@&@  阅读(1314)  评论(0)    收藏  举报