C# 识别屏幕数量?
如何在 C# 中使用一个函数来运行窗口识别,该函数将在屏幕上显示数字 1、2...,就像我们右键单击屏幕(属性)然后转到“屏幕分辨率”和单击“识别”即可显示数字。
我们可以在 C# 中做到这一点吗?
How to have a function in C# to run the window identification, which will show the numbers 1, 2, ... on the screen same way as we do it by right click on the screen (properties) then we go to Screen Resolution and show the numbers by clicking on Identify.
Can we do that in C#?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,查看 Screen 类: http://msdn .microsoft.com/en-us/library/system.windows.forms.screen.aspx
您可以通过Screen.AllScreens获取所有屏幕的列表。
Yes, look at the Screen class: http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx
You can get a list of all screens through Screen.AllScreens.
输出:
Output:
使用
Screen.AllScreens
属性确实获取了附加到系统的监视器的数组。然后
Screen.DeviceName
属性会给你它的名字。然而,这可能与 MSDN 警告的数字不同:我会先检查一下,看看这是否满足您的需要。
Using the
Screen.AllScreens
Property does get an array of the monitors attached to the system.Then
Screen.DeviceName
Property will give you it's name. However, that might not be the same as the number as the MSDN warns:I'd check this first to see if this gives you what you need.