RemoteProcess Class
This documentation is archived and is not being maintained.

RemoteProcess Class

Visual Studio 2008

Represents a process on the device that can be started and stopped.

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

public class RemoteProcess

Use the Device.GetRemoteProcess method to get an instance of this object.

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

class source
    static void Main(string[] args)

        // Get the datastore object.
        DatastoreManager dsmgr = new DatastoreManager(1033);

        // Get the platform object.
        Platform platform = GetPlatformByName("Windows Mobile 5.0 Pocket PC SDK", dsmgr);

            // Get the default device in the platform, usually an emulator.
            Device device = platform.GetDevice(platform.GetDefaultDeviceId());


            if (device.IsConnected())
                // Start the Calculator.
                RemoteProcess rp = device.GetRemoteProcess();
                rp.Start("\\windows\\calc.exe", "");

                // List all running processes.
                Console.WriteLine("Type the number of the process you want to end\r\n");
                Collection<RemoteProcess> processes = device.GetRunningProcesses();
                for (int i = 0; i < processes.Count; i++)
                    Console.WriteLine(i + ")  " + processes[i].FileName + 
                        " [" + processes[i].ToString() + "]");

                // Get user input and end the process. 
                int index = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Attempting to stop " + processes[index].FileName);
                if (processes[index].HasExited())
                    Console.WriteLine("Process exited with code: " +
                // pause

        catch (System.Exception e)

    // Returns a platform if the supplied name can be found in the datastore. 
    // Returns null pointer if platform cannot be found. 
    private static Platform GetPlatformByName(string p, DatastoreManager dsmgr)
        // Get all platforms in the datastore.
        Collection<Platform> platforms = dsmgr.GetPlatforms();

        // Find the platform whose name matches the parameter. 
        foreach (Platform platform in platforms)
            if (platform.Name == p) return platform;
        return null;        


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