Winfrom的获取方法。
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
Webfrom的获取方法1、进入首页的时候加脚本把屏宽存到cookie 中。
var str = "pix" + "=" + escape(screen.width+"*"+screen.height);
document.cookie = str;
2、C#后台调用
string[] pix = Page.Request.Cookies["pix"].Value.Split('*');
//pix[0]:宽
//pix[1]:高