Platform Class
The document is archived and information here might be outdated

Platform Class

Visual Studio 2008

Represents a Windows CE based platform, such as Windows Mobile 5.0 Pocket PC, that is registered in the Datastore.

Namespace:  Microsoft.SmartDevice.Connectivity
Assembly:  Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)

public class Platform

This class does not have any constructors. To get an instance, use DatastoreManager.GetPlatform or DatastoreManager.GetPlatforms.

using System;
using System.Collections.ObjectModel;
using Microsoft.SmartDevice.Connectivity;

class Example
{
    static void Main(string[] args)
    {
        // Get datastore object
        DatastoreManager dsmgr = new DatastoreManager(1033);

        // Get the platforms in the Datastore
        Collection<Platform> platforms = dsmgr.GetPlatforms();

        // For each platform, output name, ID, and platform properties. 
        foreach (Platform platform in platforms)
        {
            Console.WriteLine("Platform Name: " + platform.Name + "    ID: " + platform.Id);
            Console.WriteLine("    OSVersion: " + platform.GetProperty("OSVersion"));
            Console.WriteLine("    OSVersion: " + platform.GetOSVersion().ToString());
            Console.WriteLine("    DefaultPlatform: " + 
                platform.GetProperty("DefaultPlatform"));
            Console.WriteLine("    DefaultDevice: " + platform.GetProperty("DefaultDevice"));
            Console.WriteLine("    ShortName: " + platform.GetProperty("ShortName"));
            Console.WriteLine("    DefaultFormFactor: " + 
                platform.GetProperty("DefaultFormFactor"));            
        }

        Console.ReadLine();
    }
}

System.Object
  Microsoft.SmartDevice.Connectivity.Platform

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2016 Microsoft