开发者

Error of screen resolution using PrimaryMonitorSize or Caps

I have serious problems to detect screen resolution under vista64. I have 2 methods using C# to find the resolution backside of a webpage. Client side resolution using javascript is fine but backside nothing is correct.

  1. int deskWidth = SystemInformation.PrimaryMonitorSize.Width; return 1024
  2. IntPtr hdcSrc = User32.GetDesktopWindow(); int width = GetDeviceCaps(hdcSrc, HORZRES); return 1024

After many changes is screen res. these methods are always returning the same value 1024开发者_如何学编程. In the past these methods worked fine but windows update is here.

Can someone help me to fix this issue or suggest another way to get the resolution that works?

Many thanks for your answers.


It is not possible to detect the browser's screen resolution directly on the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜