我如何知道用户是否在使用笔记本电脑 [英] How can I tell if a user is using a laptop

查看:126
本文介绍了我如何知道用户是否在使用笔记本电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种使.Net Winform应用程序检测我的应用程序是否在笔记本电脑或工作站上打开的方法。

I need a way for my .Net Winform app to detect if my app is opened on a Laptop or a Workstation.

我看过环境 SystemInformation ,但是徒劳无功。 WMI 会成功吗?

I have looked at Environment and SystemInformation but to no avail. Would WMI do the trick?

感谢方向...。

根据要求,我有一个使用合并复制的应用程序,允许我们的用户在会员住宅中工作。有些使用该程序的人从不去现场,因此只有塔。这是仅适用于工作的应用程序,因此我们的系统受到了一定程度的控制。就像,在台式机上没有UPS,在笔记本电脑上也没有CPU。

As requested I have an application that uses Merge Replication to allow our users to work in Members homes. Some who use the program never go in the field and as such only have towers. This is a WORK only app so our systems are somewhat controlled. As in, no UPS on Desktops and No Laptop CPU either.

我已经将DAL设置为能够根据设置在本地SQL和中央服务器之间切换SQL Server。我希望能够根据那里的系统自动设置。

I have setup my DAL to be able to switch, based an a setting, between local SQL and the Central SQL Server. I would like to be able to set this automatically based on there system.

如果是笔记本电脑,那么他们应该指向本地(如果是塔楼)的中央。

If a laptop then they should be pointing local if a tower, centrally.

这有帮助吗?为了不弄乱答案,我故意将其保留。我为实现相反的道歉。

Does this help? I deliberately left it off before to don't clutter the answers. My apologies for apologies for accomplishing the opposite.

推荐答案

由于涉及到极端情况,这是一个很难解决的问题。我现在不知道您的应用程序需要多精确,但是这是一种可靠的方法来确定用户是否在立体笔记本电脑上。

This is a really hard problem to solve because of the edge cases involved. I don'tk now how accurate you need to be for your application, but here is a reliable way to find out if the user is on a sterotypical laptop.

Win32_Battery

您可能想看一下EstimatedRunTime。

You might want to take a look at EstimatedRunTime.


EstimatedRunTime

Data type: uint32
Access type: Read-only

Estimate in minutes of the time to battery charge depletion under the

存在的情况下,以分钟为单位的电池电量消耗估算值如果公用事业
的电源关闭,丢失或保持关闭状态,
或笔记本电脑与
电源断开连接,则处于负载状态。此属性是从CIM_Battery继承的

present load conditions if the utility power is off, or lost and remains off, or a laptop is disconnected from a power source. This property is inherited from CIM_Battery.

您还可能要检查:

Win32_PortableBattery

此外,这是一个有关类似问题以及与UPS交易的有趣讨论。

Also, here's an interesting discussion of a similar problem and dealing with UPS.

http://forum.bigfix.com/viewtopic.php?pid=19908

具体地说:

"Microsoft ACPI-Compliant Control Method Battery"

此外,如注释中所述,您还必须考虑将笔记本电脑上的用户插入电池而断开电池连接。

Also, as noted in the comments, you will have to consider users on a laptop plugged into the wall with the battery disconnected.

这篇关于我如何知道用户是否在使用笔记本电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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