开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜