开发者

Error of screen resolution using PrimaryMonitorSize or Caps

开发者 https://www.devze.com 2023-01-14 08:32 出处:网络
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

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

精彩评论

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

关注公众号