Share via


IWMSPlayers.RemoveAll (Visual Basic .NET)

banner art

Previous Next

IWMSPlayers.RemoveAll (Visual Basic .NET)

The RemoveAll method disconnects all players from the server and removes them from the IWMSPlayers collection.

Syntax

  IWMSPlayers
  .RemoveAll()

Parameters

This method does not take any parameters.

Return Values

This method does not return a value.

Remarks

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

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub RemoveAllConnections()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Players As IWMSPlayers

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlayers object.
    Players = Server.Players

    ' Remove all of the connections from the collection.
    Players.RemoveAll()

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

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