IWMSPlayers.Remove (C#)

The Remove method disconnects a specific player from the server and removes it from the IWMSPlayers collection.

IWMSPlayers.Remove(
  object  varIndex
);

Arguments

varIndex

[in] object that specifies the item to be removed from the collection.

Return Value

This method does not return a value.

If this method fails, it throws an exception.

Number

Meaning

0x8002000B

Indicates that varIndex is an invalid index location.

Remarks

If you created a previous instance of the IWMSPlayers collection, you must call IWMSPlayers.Refresh to update the object.

Example

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

// Declare variables.
WMSServer          Server;
IWMSPlayers        Players;

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

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

    // Remove the first connection from the collection.
    Players.Remove (0);
}
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.