gpt4 book ai didi

ajax - "Screen is not a member of My.MyComputer"

转载 作者:行者123 更新时间:2023-12-04 04:49:05 26 4
gpt4 key购买 nike

我对使用 AJAX(通过/与 Visual Studio 2012)使我的网页更加动态非常感兴趣。但是我对这个错误感到非常困惑我得到..

'Screen' is not a member of "My.MyComputer"



我想要做的就是获取屏幕尺寸。
我查看了整个谷歌,几乎每次都发现这样做的唯一方法是:
My.Computer.Screen.Bounds.Height
My.Computer.Screen.Bounds.Width

要么
Screen.PrimaryScreen.Bounds.Width
Screen.PriamryScreen.Bounds.Height

我每次都收到错误.. 第二种方法有点不同;它说:

'Screen' hasn't been declared.

最佳答案

JavaScript 它是小写 screen :

screen.height;
screen.width;

演示: jsFiddle

.net@GeorgeJohnston指出你需要:

The Screen object is found in the namespace, System.Windows.Forms This is not going to be in a Web Forms project by default.

关于ajax - "Screen is not a member of My.MyComputer",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17709202/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com