IWMSPlayer.UserName (C#)

banner art

Previous Next

IWMSPlayer.UserName (C#)

The UserName property retrieves the name of the authenticated player.

Syntax

  String = IWMSPlayer.UserName;

Property Value

A String containing the name.

Remarks

This property is read-only.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer          Server;
IWMSPlayers        Players;
IWMSPlayer         Player;

string             strName;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlayers object.
    Players = Server.Players;

    // Retrieve information about each client connection.
    for (int i = 0; i < Players.Count; i++)
    {
        Player = Players[i];

        // Retrieve the user name of the client.
        strName = Player.UserName;
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices

Namespace: Microsoft.WindowsMediaServices.Interop

Assembly: Microsoft.WindowsMediaServices.dll

Library: WMSServerTypeLib.dll

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next