如何使用.NET关闭特定的监视器? [英] How to turn off particular monitor with .NET?

查看:167
本文介绍了如何使用.NET关闭特定的监视器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OK,我知道有关于这个主题相当多的职位。然而,他们没有提供解决我的问题:我不想只是关闭我的显示器上,我希望我的代码以关闭特定显示器。大多数人指的是URL,的 http://fci-h.blogspot.com/2007/03/turn-off-your-monitor-via-code-c.html ,不帮助这里,因为它会关闭所有的显示器。

OK, I know there are quite a few posts on this topic. However, none of them provide the solution to my issue: I don't want just to turn off my monitor(s), I wish my code to turn off a specific monitor. The URL the most people refer to, http://fci-h.blogspot.com/2007/03/turn-off-your-monitor-via-code-c.html, doesn't help here, as it turns off all the displays.

所以,我有我的笔记本电脑的屏幕和一个额外的外部显示器。虽然我看电影,我切换显示到外接显示器和我的笔记本电脑屏幕变黑,但是,它仍然是上,并在黑暗中发光。我想将其关闭。谁能帮助吗?

So, I have my laptop screen and an additional external monitor. While I'm watching movies, I switch the display to the external monitor and my laptop screen goes black, however, it's still on and glowing in the dark. I wish to turn it off. Could anyone help please?

编辑:有什么办法来acomplish这一点,这意味着它不需要有在.net中写入。基本上,我只是需要一个.exe文件,该文件能够把特定的显示器关闭,并在交替进行。

Is there any way to acomplish this, meaning it needn't have to be written in .Net. Basically, I just need an .exe file that's able to turn the particular monitor off and on alternately.

推荐答案

它看起来像有关闭特定的显示器没有什么好办法,但它是可以设置你的笔记本电脑的背光调至最低亮度。根据你的Windows版本,也有不同的方法来做到这一点:

It looks like there's no good way of turning off a specific monitor, but it is possible to set your laptop's backlight to minimum brightness. Depending on which version of Windows you have, there are different ways to do it:

  • send IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS I/O control as described here: http://msdn.microsoft.com/en-us/magazine/dvdarchive/cc163415.aspx
  • use WMI method WmiSetBrightness as described here: http://stackoverflow.com/questions/373297/what-api-call-would-i-use-to-change-brightness-of-laptop-net/799207#799207
  • use Win API SetMonitorBrightness, but I don't know of anybody who has done it in C#.

这篇关于如何使用.NET关闭特定的监视器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆