Lenguaje

RemoteSystemSession.CreateWatcher Método

Definición

Inicializa y devuelve un objeto RemoteSystemSessionWatcher para supervisar la presencia de sesiones remotas.

public:
 static RemoteSystemSessionWatcher ^ CreateWatcher();
 static RemoteSystemSessionWatcher CreateWatcher();
public static RemoteSystemSessionWatcher CreateWatcher();
function createWatcher()
Public Shared Function CreateWatcher () As RemoteSystemSessionWatcher

Devoluciones

Objeto de monitor que se va a usar para detectar sesiones remotas.

Requisitos de Windows

Requisitos Description
Características de aplicaciones
remoteSystem

Ejemplos

Consulte el ejemplo de código siguiente para ver el proceso de detección de una sesión remota.

// Discover an existing shared experience.
public void DiscoverExistingSessions() {

    // create a watcher for remote system sessions
    RemoteSystemSessionWatcher sessionWatcher = RemoteSystemSession.CreateWatcher();

    // register a handler for the "added" event
    sessionWatcher.Added += async (sender, args) => {

        // get a reference to the info about the discovered session
        RemoteSystemSessionInfo sessionInfo = args.RemoteSystemSessionInfo;

        // update the UI with the sessionInfo.DisplayName and 
        // sessionInfo.ControllerDisplayName strings. Save a reference to 
        // this RemoteSystemSessionInfo, to use when the user selects
        // this session from the UI

        //...
    };

    // Begin watching
    sessionWatcher.Start();
}

Se aplica a