Partager via


IWMSPlayers Object (Visual Basic .NET)

The IWMSPlayers object contains a collection of players that are connected to the server. Each player is associated with an IWMSPlayerIWMSPlayer Object (Visual Basic .NET). You can use the IWMSPlayer object to retrieve properties for a specific player.

The IWMSPlayers object exposes the following properties and methods.

Property

Description

Count

Retrieves the number of IWMSPlayer objects contained in the IWMSPlayers collection.

Item

Retrieves a specific IWMSPlayer object from the IWMSPlayers collection.

length

Retrieves the number of IWMSPlayer objects that are contained in the IWMSPlayers collection. This method is provided for JScript compatibility.

Method

Description

Refresh

Updates the list of IWMSPlayer objects in the IWMSPlayers collection to reflect the connected players.

Remove

Disconnects a specific player from the server and removes it from the IWMSPlayers collection.

RemoveAll

Disconnects all players from the server and removes them from the IWMSPlayers collection.

Example

The following example illustrates how to retrieve an IWMSPlayers object.

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

Private Sub RetrieveObj()

    ' 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

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

See Also

Reference

IWMSPlayer Object (Visual Basic .NET)

IWMSPublishingPoint Object (Visual Basic .NET)

IWMSServer Object (Visual Basic .NET)

Concepts

Server Object Model (Visual Basic .NET)