Share via


IWMSPlayers.Remove (C#)

banner art

Previous Next

IWMSPlayers.Remove (C#)

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

Syntax

  IWMSPlayers
  .Remove(
  object  varIndex
);

Parameters

varIndex

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

Return Values

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 Code

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.

See Also

Previous Next