开发者

How can I know if the computer is desktop or laptop? by c# code [duplicate]

开发者 https://www.devze.com 2023-01-26 16:57 出处:网络
This question already has answers 开发者_JAVA技巧here: Closed 12 years ago. Possible Duplicate: How to check the machine type? laptop or desktop?
This question already has answers 开发者_JAVA技巧here: Closed 12 years ago.

Possible Duplicate:

How to check the machine type? laptop or desktop?

How do I know if the computer is desktop or laptop? by c# code


This is not possible. What is the difference exactly? Best guess is to think of components that only appear in laptops, battery, mobile CPUs etc.

Why do you want to know that btw? Some UI logic because of it?

Also remind Virtual Machines can run on either.


Check the battery status!


 if (SystemInformation.PowerStatus.BatteryChargeStatus == BatteryChargeStatus.NoSystemBattery)
 {
    //Desktop
 }
 else
 {
      //Laptop
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消