
(wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth)>#
for /f "skip=1 tokens=1,2" %%i in ('type #') do (
set a=%%i
set b=%%j
)
del /f/q #
echo 高度:%a%
echo 宽度:%b%
pause
屏幕的长宽就是屏幕的分辨率,用下面的代码实现,每句后面已添加注释
Dim x As Integer, y As Integer '定义2个整数型变量
x = ScreenWidth / ScreenTwipsPerPixelX '获取屏幕宽度
y = ScreenHeight / ScreenTwipsPerPixelY '获取屏幕高度
上面是vb的语法
下面是VbNet的语法:
Dim x, y As Long '定义2个整数型变量
x = ScreenPrimaryScreenBoundsWidthToString '获取屏幕宽度
y = ScreenPrimaryScreenBoundsHeightToString '获取屏幕高度
<html>
<script>
function a(){
documentwrite(
"屏幕分辨率为:"+screenwidth+""+screenheight //最好是windowscreen
+"<br />"+
"屏幕可用大小:"+screenavailWidth+""+screenavailHeight
+"<br />"+
"网页可见区域宽:"+documentbodyclientWidth
+"<br />"+
"网页可见区域高:"+documentbodyclientHeight
+"<br />"+
"网页可见区域宽(包括边线的宽):"+documentbodyoffsetWidth
+"<br />"+
"网页可见区域高(包括边线的宽):"+documentbodyoffsetHeight
+"<br />"+
"网页正文全文宽:"+documentbodyscrollWidth
+"<br />"+
"网页正文全文高:"+documentbodyscrollHeight
+"<br />"+
"网页被卷去的高:"+documentbodyscrollTop
+"<br />"+
"网页被卷去的左:"+documentbodyscrollLeft
+"<br />"+
"网页正文部分上:"+windowscreenTop
+"<br />"+
"网页正文部分左:"+windowscreenLeft
+"<br />"+
"屏幕分辨率的高:"+windowscreenheight
+"<br />"+
"屏幕分辨率的宽:"+windowscreenwidth
+"<br />"+
"屏幕可用工作区高度:"+windowscreenavailHeight
+"<br />"+
"屏幕可用工作区宽度:"+windowscreenavailWidth
);
}
function set_bgColor(){
documentbodystylebackgroundColor="red";
}
function set_bgImg(){
documentbodystylebackgroundImage="url(t/JS获取屏幕大小 - 风飘零 - 博客园png)";
}
</script>
<body onLoad="alert('init')" >
<input type='button' value="set_bgColor" onclick="set_bgColor();"> <br>
<input type='button' value="set_bgImg" onclick="set_bgImg()">
</body>
</html>
以上就是关于批处理获取屏幕的高度和宽度令a=高度,b=宽度,然后输出。全部的内容,包括:批处理获取屏幕的高度和宽度令a=高度,b=宽度,然后输出。、vb 中怎么获取屏幕的长宽啊、HTML怎样获取屏幕尺寸等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)