IWMSPlayer.NetworkAddress (C#)

The NetworkAddress property retrieves the network address of the client that is receiving content from the server.

string = IWMSPlayer.NetworkAddress;

Property Value

A string containing the network address.

Remarks

This property is read-only. The network address is returned by the socket on the Windows Media server. Therefore, the address can be that of the player receiving the content, but it can also be the address of the firewall, the network address translatoror the router if these are in the network path.

Example

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

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

string             strAddress;

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 IP address of the client.
        strAddress = Player.NetworkAddress;
    }
}
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.