Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How can I determine if machine is a Laptop?

Hello,

I have a VB.NET 2003 app that I am installing onto either a desktop or a laptop. I would like my program to be able to determine if I have installed it on a laptop or a desktop. I am still looking around in MSDN and on the web for an example, but I have come out empty handed so far. Any help would be appreciated.

Thank you,
Anthony
[362 byte] By [awdigrigoli] at [2007-11-11 6:54:11]
# 1 Re: How can I determine if machine is a Laptop?
What is it about a laptop that affects the operation of your application? Battery power? Screen resolution? Hard disk size? I suggest you check for those specific conditions. Otherwise, a laptop and a desktop are indistinguishable.
Phil Weber at 2007-11-11 21:49:54 >
# 2 Re: How can I determine if machine is a Laptop?
The application is used to create files either on a PDA or a Laptop. There will be one of two scenarios for each user:
1. Application is run from a desktop to save files to a PDA.
2. Application is run from a laptop and files are saved in a directory on the laptop.

Laptop users are not permitted to use a PDA.

The reason I need to know if they are using a Laptop vs a Desktop is to construct the correct path to where the files are written.

~Anthony
awdigrigoli at 2007-11-11 21:50:54 >
# 3 Re: How can I determine if machine is a Laptop?
You may have to ask the user if they're running on a desktop or a laptop. I don't know if there's any way to distinguish a laptop from a desktop in code.
Phil Weber at 2007-11-11 21:51:59 >
# 4 Re: How can I determine if machine is a Laptop?
Processors are same
RAM is same
hard-disk is same
OS is same
VGA is same

then how can be you able to distinguish both of them. You have to ask user or see some speicific voltages of the circuits. :)
NabeeL at 2007-11-11 21:52:53 >
# 5 Re: How can I determine if machine is a Laptop?
You might want to see if the folder exists for the PDA Software. If the folder exists, then the files get saved there. If the PDA Software folder does not exist, then save in the default folder.

Just a thought...

JFV
jvalvo at 2007-11-11 21:53:55 >