Desktop or device

  • Thread starter Thread starter Thore Berntsen
  • Start date Start date
T

Thore Berntsen

I have som code that runs both on the desktop and on devices. Is there any
way I can check where the app is running; on a device or on a desktop?

Thore Berntsen
 
Hi,

Thore Berntsen said:
I have som code that runs both on the desktop and on devices. Is there any
way I can check where the app is running; on a device or on a desktop?

A simple check could be something like the following:

public static bool IsDesktopWindows
{
get { return Environment.OSVersion.Platform != PlatformID.WinCE; }
}

You might find a blog entry of mine titled "What device is my application
running on?" of interest - http://www.christec.co.nz/blog/archives/77. It
explains how to detect various bits of information such as OS version,
emulator, desktop status etc.

Hope this helps,
Christopher Fairbairn
 
Just what I needed. Thanks!
Christopher Fairbairn said:
Hi,



A simple check could be something like the following:

public static bool IsDesktopWindows
{
get { return Environment.OSVersion.Platform != PlatformID.WinCE; }
}

You might find a blog entry of mine titled "What device is my application
running on?" of interest - http://www.christec.co.nz/blog/archives/77. It
explains how to detect various bits of information such as OS version,
emulator, desktop status etc.

Hope this helps,
Christopher Fairbairn
 
Back
Top